Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not find module 'shelljs'

I have an Error when I run an Apache Cordova project from Visual Studio 2015 as below.

Error   BLD401  Error : BLD00401 : Could not find module 'shelljs'. Please Go to Tools --> Options --> Tools for Apache Cordova --> Cordova Tools --> Clear Cordova Cache and try building again.

I tried to install shelljs grobally

npm install -g shelljs

But still not working.

Should I convert it to PhoneGap project and work on other IDEs?

like image 705
Mirrh Avatar asked Aug 17 '15 01:08

Mirrh


3 Answers

I found the solution that some reason the [-g] to install globally wasn't working. So what I did was installing the shelljs command in the project location as below.

Path To The Project\platforms\android\cordova

and then install "shelljs" at the location

npm install shelljs

Hope this help someone has the same issue.

like image 68
Mirrh Avatar answered Nov 15 '22 09:11

Mirrh


For me worked setting first the NODE_PATH:

export NODE_PATH=$(npm root -g)
npm install -g shelljs
like image 40
Nils Reichardt Avatar answered Nov 15 '22 11:11

Nils Reichardt


I use macOS and I had the same problem within one of the microservices we work on.

This error can persist even when we run the command npm run shelljs.

So, What I had to do was:

  • Delete node_modules folder in the project: rm -r -f node_modules
  • run npm install again
  • run npm build
  • finally: npm run start:dev

Problem solved succesfully ! :)

like image 1
Silvana Siqueira Avatar answered Nov 15 '22 10:11

Silvana Siqueira