Yeoman angular generator error - angularjs

When I'm using the angular yeoman generator, I'm getting the following error:
module.js:340
throw err;
^
Error: Cannot find module './lib/pack.js'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (C:\Users\kra\AppData\Roaming\npm\node_modules\generator-karma\node_modules\yeoman-generator\n
ode_modules\download\node_modules\decompress\node_modules\decompress-tarbz2\node_modules\tar\tar.js:171:16)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
Any idea why?
npm version 1.4.28
node version 0.10.33
yeoman version 1.3.3

Try remove your generator-karma and generator-angular, run npm cache clean, and install them again

I just had a similar issue, this might not be the solution but your version of npm is out of date, try typing:
sudo npm install npm -g
As referenced On the npm website (note they use sudo in the example but it might not be necessary). after that:
npm --version
Is currently 2.1.12 so it should be higher than that.
You can then try:
npm update
to upgrade everything to the latest version (See this page).
This may solve the problem.

Related

npm test/ jest not working

I am trying to run a test with react/jest. When I do npm test /jest, I am getting the following error:
> # test /Users/suparnasoman/Downloads/create-react-app-master
> node packages/react-scripts/scripts/test.js --env=jsdom
module.js:471
throw err;
^
Error: Cannot find module 'jest'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/suparnasoman/Downloads/create-react-app-master/packages/react-scripts/scripts/test.js:26:14)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
npm ERR! Test failed. See above for more details.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
Check if the npm package is installed successfully.
If the installation is successful check if it is installed globally/locally.
If local, you might need to provide the absolute path node_modules/bin/jest
It seems the jest module is missing, did you try npm --save install jest, or npm install as Chase mentioned?

NodeJS - Cannot find module 'spdx-license-ids'

I am new to nodejs, yeoman and having issue(Cannot find module 'spdx-license-ids') while using an angular generator. I have node, bower, grunt installed. Details below.
Error: Cannot find module 'spdx-license-ids'
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.<anonymous> (C:\Users\bdas\AppData\Roaming\npm\node_modules\generator-karma\node_modules\yeoman-generator\node_modules\read-pkg-up\node_modules\read-pkg\node_modules\normalize-package-data\node_modules\validate-npm-package-license\node_modules\spdx-correct\index.js:1:80)
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
Not sure about grunt etc, but to simply install any node library, do:
apt-get install npm
from the command line, thereafter any node module should be installed with:
npm install MODULE_NAME
e.g.:
npm install spdx-license-ids
or to install it globally so node can find it anywhere on your system (not always such a briliiant idea, but anyways), use the global -g flag:
npm install -g MODULE_NAME
Those extraneous tools can trip you up sometimes - grunt, yeoman, etc

Install ng-table with bower

hi I have a problem installing ng-table with bower
bower install ng-table
"module.js:340"
"throw err;"
^
Error: Cannot find module 'insight'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at ensureInsight (C:\Users\Samsung\AppData\Roaming\npm\node_modules\bower\lib\util\analytics.js:24:23)
at Object.setup (C:\Users\Samsung\AppData\Roaming\npm\node_modules\bower\lib\util\analytics.js:43:9)
at Object.<anonymous> (C:\Users\Samsung\AppData\Roaming\npm\node_modules\bower\bin\bower:72:11)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
I had the same problem. I tried installing bower globally.
npm install -g bower and bower install worked fine.
Use:
bower install ng-table-bundle --save
from: https://github.com/Greenek/bower-ng-table
I tried sudo npm install -g bower first and then was able to use bower install ng-table after having this issue.

Yo angular generate error

I install nodejs and npm on ubuntu 14.04, by source code.
root#wemet:~/ang# npm version
{ http_parser: '1.0',
node: '0.10.34',
v8: '3.14.5.9',
ares: '1.9.0-DEV',
uv: '0.10.30',
zlib: '1.2.8',
modules: '11',
openssl: '1.0.1j',
npm: '1.4.28' }
I installed yo and generate-angular as global This is my full package install of local:
https://gist.github.com/thinksource/ba33f0cad073f3d4dc46
When I want to do:
root#wemet:~/ang# yo angular
module.js:340
throw err;
^
Error: Cannot find module '../../string/is-string'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/usr/local/lib/node_modules/yo/node_modules/insight/n
ode_m odules/inquirer/node_modules/cli-color/node_modules/es5-ext/array/from/shim
.js:9:22)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
I do not know what is the is-string module. I check it at https://www.npmjs.com/ but can not find it.
When I run the bower cache clean:
root#wemet:~/ang# npm i make-iterator --save-dev
info trying registry request attempt 1 at 00:21:04
http GET https://registry.npmjs.org/make-iterator
http 200 https://registry.npmjs.org/make-iterator
info trying registry request attempt 1 at 00:21:04
http GET https://registry.npmjs.org/for-own
http 200 https://registry.npmjs.org/for-own
info trying registry request attempt 1 at 00:21:05
http GET https://registry.npmjs.org/for-in
http 200 https://registry.npmjs.org/for-in
make-iterator#0.1.1 node_modules/make-iterator
└── for-own#0.1.2 (for-in#0.1.3)
root#wemet:~/ang# bower cache clean
module.js:340
throw err;
^
Error: Cannot find module '../function/makeIterator_'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/usr/local/lib/node_modules/bower/node_modules/mout/
rray/collect.js:2:20)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
I find the module make-iterator, but even if I install make-iterator and I still meet error when I run bower cache clean.
I get the problem, I need to upgrade my npm version from 1.4.28 to 2.1.2.
Thank you for your attention.
answer of #user504909 will solve the problem But Good Solution is Upgrade Nodejs version from 0.10.34 to 0.12.0 As the result of upgrading Nodejs version, npm version will upgrade too from 1.4.28 to 2.1.2
To Upgrade Nodejs Version according to nodesource Blog :
# Note the new setup script name for Node.js v0.12
curl -sL https://deb.nodesource.com/setup_0.12 | sudo bash -
# Then install with:
sudo apt-get install -y nodejs
For Answer about upgrade Nodejs version with Ubuntu OS -> See This Link

yo angular cannot find module bower-config

I'm trying to get started the first time with yeoman. I want to create an angular app using the command:
yo angular
But I'm getting the following error:
Error: Cannot find module '/Users/mel/workspaces/protractor-techevent/node_modules/bower-config'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at /usr/local/lib/node_modules/generator-angular/node_modules/wiredep/node_modules/modmod/index.js:5:16
at Array.reduce (native)
at module.exports (/usr/local/lib/node_modules/generator-angular/node_modules/wiredep/node_modules/modmod/index.js:3:35)
at Object.<anonymous> (/usr/local/lib/node_modules/generator-angular/node_modules/wiredep/wiredep.js:3:26)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
I checked the yeoman faq, googled but couldn't find an answer. Does anybody have an idea?
Using OS X 10.9.4, npm 1.4.23, yeoman 1.2.1 (doctor says its ok), generator-angular 0.9.5, bower 1.3.9
That means the Node module "bower-config" is missing.
Run "npm install bower-config". And I guess "chalk" module will be missing too.
Try to re-install bower manually "npm install -g bower", this should resolve all the missing depencies.
Maybe you will also need to run
npm update -g

Resources