繁体   English   中英

Google App Engine 上的 NestJS 项目显示错误“无法写入文件”&&“EROFS:只读文件系统”

[英]NestJS Project on Google App Engine shows error "Could not write file" && " EROFS: read-only file system"

当我在 Google App 引擎上部署 NestJS 项目时,我正在努力解决如下错误。

错误 TS5033:无法写入文件“/workspace/dist/properties/dto/property.filter.dto.d.ts”:EROFS:只读文件系统,打开“/workspace/dist/properties/dto/property.filter” .dto.d.ts'。

app.yaml文件在下面

runtime: nodejs10
env: standard

default_expiration: "4d 5h"

## to specify database
beta_settings:
  cloud_sql_instances: "your instance connection name"

env_variables:
  DATABASE_HOST: "/cloudsql/your instance connection name"
  DATABASE_USERNAME: "user name"
  DATABASE_PASSWORD: "password"
  INSTANCE_CONNECTION_NAME: "your instance connection name"

handlers:
- url: /.*
  secure: always
  redirect_http_response_code: 301
  script: auto

resources:
  cpu: 1
  memory_gb: 0.5
  disk_size_gb: 10

tsconfig.json文件在下面

{
  "compileOnSave": true,
  "compilerOptions": {
    "module": "commonjs",
    "declaration": true,
    "removeComments": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "ES2017",
    "sourceMap": true,
    "outDir": "./dist",
    "allowJs": true,
    "baseUrl": "./",
    "incremental": true
  }
}

似乎我无法在 App Engine 上的 dist 文件夹中写入文件,但我不确定为什么会发生这种情况。

正如此官方文档所示:

Java 8、Java 11、Node.js、Python 3、PHP 7、Ruby、Go 1.11 和 Go 1.12+ 具有对 /tmp 目录的读写访问权限。

因此,这意味着只有在/tmp目录中,您才能执行写入操作,而其他任何您不能执行的操作都是只读的,其中将包括workspace以及dist 正如此处类似案例的答案中所阐明的那样,您需要在/tmp目录中处理您的文件,或者开始使用 App Engine Flex,您可以在其中写入其他目录。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM