2

in the Standard environment in GAE it stays that devDevependencies from package.json are ignored. But there are no such limitations for the Flexible environment. However, I'm getting parcel not found error while trying to deploy my app to GAE. Here is my app.yaml:

runtime: nodejs
env: flex

And my 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"
  }
}
user715022
  • 85
  • 4
  • 16

1 Answers1

1

The last I checked, App Engine doesn't install devDependencies because it used npm install --production by default. If you want to make sure those get installed, you have a few options:

  1. You could move everything into the dependencies section
  2. You could define your own Dockerfile, and run regular npm install inside of it before starting
  3. (probably the best) You could use a Multi-stage docker build to perform your build step in the first stage, and generate a different slimmer image that only has what you need.

Hope this helps!

Justin Beckwith
  • 7,686
  • 1
  • 33
  • 55