Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find module 'webpack' #217

Closed
theredorm opened this issue Apr 1, 2017 · 9 comments
Closed

Cannot find module 'webpack' #217

theredorm opened this issue Apr 1, 2017 · 9 comments

Comments

@theredorm
Copy link

I try to understand with webpack and such error after such launch starts ./bin/webpack-dev-server
In another terminal. PLS help me.

`module.js:327
throw err;
^

Error: Cannot find module 'webpack'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (/home/andrew/railsapp/wpacktest/node_modules/webpack-dev-server/lib/Server.js:15:17)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
`

@gauravtiwari
Copy link
Member

Have you run ./bin/rails webpacker:install?

@theredorm
Copy link
Author

theredorm commented Apr 1, 2017

@gauravtiwari yep

@theredorm
Copy link
Author

theredorm commented Apr 1, 2017

@gauravtiwari, I got this error. Can not find application.js in /home/andrew/railsapp/wpacktest/public/packs/manifest.json. Is webpack still compiling? And after I looked in Troubleshooting and executed the command ./bin/webpack-dev-server

@gauravtiwari
Copy link
Member

You get that error because webpack isn't installed. Could you run this ./bin/rails webpacker:install again please and follow the options?

@gauravtiwari
Copy link
Member

Btw, what version of webpacker you using? It's 1.1

@gambala
Copy link
Contributor

gambala commented Apr 1, 2017

Got same error. Decided this way:

  • Update nodejs to 6.x (I had 5.x).
  • Run ./bin/rails webpacker:install and ./bin/yarn install.
  • Run bin/webpack-dev-server.
  • If there will be errors about missing webpack or babel-loader - add them to package.json:
{
  "devDependencies": {
    "webpack-dev-server": "^2.4.2"
  },
  "dependencies": {
    // another dependencies
    "babel-core": "^6.24.0",
    "babel-loader": "^6.4.1",
    "webpack": "^2.3.2",
  }
}
  • Run ./bin/yarn install and bin/webpack-dev-server again.

@ytbryan
Copy link
Contributor

ytbryan commented Apr 1, 2017

Check the prerequisites of webpacker 1.1 https://github.com/rails/webpacker#prerequisites

@dhh
Copy link
Member

dhh commented Apr 1, 2017 via email

@theredorm
Copy link
Author

@gambala, thx bro.
@gauravtiwari , sorr, i had node js ~4.v and after I upgraded to 6 all earned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants