我有一个非常简单的Node.js/tyescript项目,我总是能够使用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=232127403419
我不确定它为什么要try 运行构建.我总是在本地执行NPM运行构建,然后运行gCloud命令进行部署.进行构建所需的一些文件都在.gclouguatore中,因为我只想上传编译后的Java脚本,而不是我的打字脚本/webpack的东西.我以前从来没有看过云构建,但现在我看到以前成功的构建甚至从来没有try 过在我的项目上构建,而新的try 做到了.
我是一名业余爱好开发人员,没有谷歌云的支持合同,我希望其他人也遇到同样的问题,可以帮助我解决问题.
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个