score:1

Could you show your dependencies in the package.json file?

I had a similar problem running gcloud app deploy

Error: Cannot find module 'webpack-dev-server'
at Function.Module._resolveFilename (module.js:469:15)

I solved the issue moving the given dependency (wepack-dev-server) from devDependencies to dependencies in package.json.

In case somebody else has the same problem I suggest to have look at your dependencies in package.json. dependencies are required to run, devDependencies only to develop, e.g.: unit tests, Coffeescript to Javascript transpilation, minification,

score:2

You need to change your scripts. Installing Webpack globally in App Engine is not the best approach, use it directly from node_modules.

First, ensure webpack is in your production dependencies:

npm install --save webpack

Edit your package.json script:

"scripts": {
    "start": "node server.js",
    "bundle": "./node_modules/.bin/webpack --config webpack.config.js",
    "prestart": "npm run bundle"
},

Now a plain npm install in a clean installation will be enough for bundling your application.


Related Query