I’m trying to figure out what parameters Google App Engine uses when it runs npm install during deployment. I noticed something weird in my build logs that shows this line:
This seems strange because I have NODE_ENV set to production in my app.yaml file. Does GAE always use development mode for package installation even when you specify production environment?
I want to understand what exact commands and environment variables are being used when GAE installs my dependencies. Is there a way to see the full npm command with all its options that gets executed during the build process?
The text in parentheses looks like an environment variable but I’m not sure if that’s actually what npm is using or just some logging output.
GAE’s npm behavior can indeed be perplexing since it runs npm install twice during deployment. Initially, it installs everything, including devDependencies, hence the NODE_ENV=development in the logs, to accommodate any build steps. Following that, it executes a second install with --production to assemble the final runtime bundle. This clarifies the seemingly mixed build output. The details in parentheses are merely logging metadata and not actual command parameters. To confirm this, check your deployed app; it should only have the production dependencies, regardless of what the logs indicate. Although GAE’s process is not very transparent, it ultimately adheres to the NODE_ENV setting you specified in your app.yaml.
I had the same issue with my GAE deployment. The logging in parentheses doesn’t show the actual npm command - it’s just what the build system displays. When your app.yaml sets NODE_ENV to production, GAE should run npm install with --production flag. But sometimes the build process looks like it’s using dev mode temporarily. GAE doesn’t give you an easy way to see the full npm command that’s actually running during deployment.
yea, so google app engine usually does npm install --production if NODE_ENV is production, but sometimes you still see dev dependencies in logs. that part in parentheses is just logging info, not the real npm flags. it can be frustrating for troubleshooting.