我有一个非常简单的Node. js/ typescript项目,我总是能够使用npm run build
构建,然后使用以下命令在Google App Engine Standard for Node.js上部署:cloud app deploy --version=x
从今天起,它给出以下错误:
Do you want to continue (Y/n)? y
Beginning deployment of service [default]...
╔════════════════════════════════════════════════════════════╗
╠═ Uploading 0 files to Google Cloud Storage ═╣
╚════════════════════════════════════════════════════════════╝
File upload done.
Updating service [default]...failed.
ERROR: (gcloud.app.deploy) Error Response: [9] Cloud build 2e4915bf-4af5-4ede-80c8-196d55653451 status: FAILURE
> frontend@0.1.0 build
> webpack
assets by status 0 bytes [cached] 1 asset
WARNING in configuration
The 'mode' option has not been set, webpack will fallback to 'production' for this value.
Set 'mode' option to 'development' or 'production' to enable defaults for each environment.
You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/configuration/mode/
ERROR in main
Module not found: Error: Can't resolve './src' in '/workspace'
resolve './src' in '/workspace'
using description file: /workspace/package.json (relative path: .)
Field 'browser' doesn't contain a valid alias configuration
using description file: /workspace/package.json (relative path: ./src)
no extension
Field 'browser' doesn't contain a valid alias configuration
/workspace/src is not a file
.js
Field 'browser' doesn't contain a valid alias configuration
/workspace/src.js doesn't exist
.json
Field 'browser' doesn't contain a valid alias configuration
/workspace/src.json doesn't exist
.wasm
Field 'browser' doesn't contain a valid alias configuration
/workspace/src.wasm doesn't exist
as directory
existing directory /workspace/src
using description file: /workspace/package.json (relative path: ./src)
using path: /workspace/src/index
using description file: /workspace/package.json (relative path: ./src/index)
no extension
Field 'browser' doesn't contain a valid alias configuration
/workspace/src/index doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
/workspace/src/index.js doesn't exist
.json
Field 'browser' doesn't contain a valid alias configuration
/workspace/src/index.json doesn't exist
.wasm
Field 'browser' doesn't contain a valid alias configuration
/workspace/src/index.wasm doesn't exist
webpack 5.75.0 compiled with 1 error and 1 warning in 197 ms
Full build logs: https://console.cloud.google.com/cloud-build/builds;region=us-central1/2e4915bf-4af5-4ede-80c8-196d55653451?project=xxxxx
我不知道为什么它试图运行一个构建。我总是在本地执行npm run build,然后运行gcloud命令进行部署。构建所需的一些文件在.gcloudignore中,因为我只想上传编译后的javascript,而不是我的typescript/webpack文件。我以前从来没有看过云构建,但现在我看到以前成功的云构建甚至从来没有尝试过在我的项目上进行构建,而新的尝试则是如此。
我是一个业余爱好开发者,没有谷歌云的支持合同,我希望其他人遇到同样的问题,可以帮助我。
Google Cloud SDK 413.0.0
alpha 2023.01.06
beta 2023.01.06
bq 2.0.84
bundled-python3-unix 3.9.12
cloud-datastore-emulator 2.3.0
core 2023.01.06
gcloud-crc32c 1.0.0
gsutil 5.17
To take a quick anonymous survey, run:
$ gcloud survey
Node.js版本:
leejjon@mymachine:~/projects/Blindpool$ node --version
v18.14.1
我的代码可以在这里找到:https://github.com/Leejjon/Blindpool/tree/master/blindpool-frontend
1条答案
按热度按时间pqwbnv8z1#
2023年4月11日发布的版本对Nodejs应用程序进行了突破性的更改
对于所有使用Node.js运行时的服务,如果您在package.json文件中定义了npm build脚本,npm run build现在会在部署过程中自动运行。
如果您不希望它运行构建,那么将
"gcp-build":""
添加到package.json
文件的scripts
部分/节