在GAE的标准环境中,package.json的devDevependency为ignored。但是Flexible environment没有这样的限制。但是,尝试将我的应用程序部署到GAE时,出现包裹未找到错误。 这是我的app.yaml:
runtime: nodejs
env: flex
还有我的package.json:
{
"main": "index.js",
"scripts": {
"dev": "nodemon -w ./server bin/runServer -e js,json",
"build:client": "parcel build client/index.html",
"start": "npm run build:client && cross-env NODE_ENV=production node ./bin/runServer"
},
"dependencies": {
"@material-ui/core": "^3.1.2",
"@material-ui/icons": "^3.0.1",
"classnames": "^2.2.6",
"express": "^4.16.3",
"lodash": "^4.17.11",
"material-ui": "^0.20.2",
"morgan": "^1.9.1",
"react": "^16.5.2",
"react-dom": "^16.5.2",
"react-loadable": "^5.5.0",
"react-multi-lang": "^1.0.2",
"react-router": "^4.3.1",
"react-router-dom": "^4.3.1",
"whatwg-fetch": "^3.0.0"
},
"devDependencies": {
"@babel/core": "^7.1.2",
"@babel/plugin-proposal-class-properties": "^7.1.0",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
"@babel/preset-env": "^7.1.0",
"@babel/preset-react": "^7.0.0",
"@babel/register": "^7.0.0",
"cross-env": "^5.2.0",
"nodemon": "^1.18.4",
"parcel": "^1.10.1",
"parcel-bundler": "^1.10.1"
}
}
答案 0 :(得分:0)
我最后检查的App Engine没有安装devDependencies,因为默认情况下它使用npm install --production
。如果要确保已安装它们,则有几种选择:
dependencies
部分Dockerfile
,并在开始之前在其中运行常规npm install
希望这会有所帮助!