matewilk
matewilk

Reputation: 1301

Webpack Cannot find module ./lib/api/node.js @ multi main

I removed all node_modules from my project and installed it again.

Before removing them everything was working fine. Now I'm getting an error at the end of webpack build :

enter image description here

After it happened I:

Unfortunatelly I'm still getting the same error.

When I try to run the project with npm run dev where dev in package.json file is: "dev": "webpack-dev-server --progress --colors"

I'm getting the following error :

enter image description here

where ./app/index.jsx is the entry file for my project

Before all was fine, the directory structure was indentical, I haven't touched anything in the project apart from removing node_modules and installing it all again.

webpack version: 1.13.2 node version: 7.0.0 webpack-dev-server version: 1.16.2

Any ideas greatly appreciated.

Thanks

Upvotes: 2

Views: 614

Answers (2)

king0 liam
king0 liam

Reputation: 11

1.remove foldernode_modules
2.run npm install

thx! my problems is solved by these two steps only !

Upvotes: 0

matewilk
matewilk

Reputation: 1301

Answering my own question just in case someone encounters the same issue:

I did the following steps:

  • remove webpack and webpack-dev-server from the package.json file
  • remove node_modules folder
  • run npm install
  • install both again (latest versions) npm install --save-dev webpack webpack-dev-server

After installing them the versions are as follows:

webpack: 1.13.3 (was 1.13.2 before) | webpack-dev-server: 1.16.2

Done!

Upvotes: 1

Related Questions