mern-starter icon indicating copy to clipboard operation
mern-starter copied to clipboard

Error: Cannot find module 'webpack' on production environment

Open rbudiharso opened this issue 7 years ago • 1 comments

Why is it webpack needed for production environment even after I build for production? Steps to reproduce:

  1. mern init foo
  2. cd foo
  3. npm install
  4. npm start // => runs OK
  5. npm run build
  6. npm run build:server
  7. rm -rf node_modules
  8. npm install --production
  9. npm run start:prod
  10. error screenshot from 2016-10-25 09-17-24

I believe those are the steps to deploy in production mode and npm install --production is what we should do, but that render the app unusable. If that's not the case then webpack and its plugins should be in dependencies and not in devDependencies in package.json.

rbudiharso avatar Oct 25 '16 02:10 rbudiharso

Same issue found, anyone could help?

wangyangjun avatar Dec 10 '16 11:12 wangyangjun