Cannot find module 'glob'


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

By : Stav Alfi


I had the same error on Windows 10,


For now, run npm install --save glob in your project, or install globally npm install -g glob like Eric mentioned.

This is listed in Issue #233 on the angluar-cli project.

The missing glob dep has been fixed in latest master. This will go out in the next release. - posted 4/21/16

Versions ran with this fix:

  • angular-cli: 0.0.33
  • node: 5.9.1
  • glob: 7.0.3
  • angular2: 2.0.0-beta.14

This video can help you solving your question :)
By: admin