I have an issue with pushing an application that uses webpack to dokku.
Webpack itself is located in the devDependencies of the package.json.
Once pushed it starts installing node_modules. But once it starts to execute the 'postinstall' script it says the following:
sh: 1: webpack: not found
npm ERR! Linux 3.16.0-30-generic
npm ERR! argv "/tmp/build/.heroku/node/bin/node" "/tmp/build/.heroku/node/bin/npm" "install" "--quiet" "--userconfig" "/tmp/build/.npmrc"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] postinstall: `webpack`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'webpack'.
npm ERR! This is most likely a problem with the profortool-app package,
npm ERR! not with npm itself.
Things I tried:
dependencies' instead of 'devDependencies'None of these things worked out. Does anyone have an idea how to fix this?
Regards, Patrick van Vuuren
I have solved the issue by placing devDependencies in normal dependencies (probably has something to do with being in production mode on dokku) and I changed the postinstall script to:
node_modules/.bin/webpack
Probably dokku has to be configured to development mode to allow dependencies to sit in devDependencies.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With