generator-angular
generator-angular copied to clipboard
module.js:341 throw err - Error: Cannot find module './lib/env'
Not sure this is the fault of the generator, but other generators do work. Whenever I am running yo angular I'm getting this:
module.js:341 throw err; ^
Error: Cannot find module './lib/env' at Function.Module._resolveFilename (module.js:339:15) at Function.Module._load (module.js:290:25) at Module.require (module.js:367:17) at require (internal/module.js:16:19) at Object.
(/opt/local/lib/node_modules/generator-angular/node_modules/yeoman-generator/main.js:8:19) at Module._compile (module.js:413:34) at Object.Module._extensions..js (module.js:422:10) at Module.load (module.js:357:32) at Function.Module._load (module.js:314:12) at Module.require (module.js:367:17)
Version Data:
- Mac 10.11.2
- node 5.5.0 - regular install, not via Macports/Homebrew
- npm 3.3.12
- yo 1.6.0
I tried running this and didn't have any luck:
sudo npm cache clean && \
sudo npm install -gf yo && \
sudo npm install -gf generator-angular
set NODE_PATH=C:\Users\MyUser\node_modules This is the soluction
That worked. On my mac I just added this in my .bash_profile: export NODE_PATH="/usr/local/lib/node_modules"
The Comant Is success??
I have also this problem in windows -7
cordova create hello com.example.hello HelloWord Module.js:341
Cannot find Module ?
how to install the module and which module is need there?
I have to same problem in mac. I try to "export NODE_PATH="/usr/local/lib/node_modules" add in .bash_profile but the problem is not resolved.
Same problem under Ubuntu 14.04. This worked for me:
nano ~/.bashrc add the export line which was /usr/lib/node_modules in my case: export NODE_PATH="/usr/lib/node_modules"
Save the file, close the console and open a new console. Retry - should work now.
Thanks pals, setting up environment variable on Win7 helped! NODE_PATH=c:\Program Files\nodejs\node_modules\