Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot find module 'glob'

Tags:

Tell me what extra information you need

Im following a simple guide to activate my first angular 2 app and did the following actions on the clr:

npm i -g angular-cli    //(worked)  ng new ponyracer        //(error: Cannot find module 'glob') ng serve                //(error: Cannot find module 'glob')  Cannot find module 'glob' Error: Cannot find module 'glob'     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\stavalfi\AppData\Roaming\npm\node_modules\angular-cli\addon\ng2\tasks\lib-install.js:11:19)     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)     at require (internal/module.js:12:17) 

Any explations about the commands "ng new ponyracer" and "ng serve" will be great.

Thanks, Stav

like image 696
Stav Alfi Avatar asked Feb 20 '16 15:02

Stav Alfi


1 Answers

There's already an issue reporting this error message. The workaround until the next release is to install glob for the project (npm install --save glob)

Regarding the commands, according to their repository under Generating and serving an Angular2 project via a development server the commands are as follow

ng new ponyracer : This command will create a project named ponyracer (a folder named ponyracer with all the set up in it).

ng serve : This command will run the live reload server to serve the application so you can see it in your browser.

PS : If you test the solution suggested in the issue it would be nice of you to report if it worked or not.

PS2 : I tested now (I fixed my error) and I cannot reproduce your error. I'm using node v5.5.0 and npm v3.7.3. Can you specify which node and npm versions are you using?

like image 174
Eric Martinez Avatar answered Sep 30 '22 20:09

Eric Martinez