question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot find module 'glob' in newly generated project

See original GitHub issue

Seeing an issue with a newly generated project:

$ ng build
Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://www.ember-cli.com/user-guide/#watchman for more info.
BuildingCould not require 'angular-cli-build.js': Cannot find module 'glob'
Error: Could not require 'angular-cli-build.js': 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> (/Users/cmartin/tmp/ngclitest/node_modules/angular-cli/lib/broccoli/angular2-app.js:3:14)
    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)

Mac OSX El Capitan Angular CLI Version: latest master e5237f2f4f2cd040d493e30b647ee7343d6938bc Node: 4.4.2 NPM: 2.14.21

Repro steps:

$ git clone https://github.com/angular/angular-cli.git
$ cd angular-cli
$ git checkout e5237f2f4f2cd040d493e30b647ee7343d6938bc
$ npm i
$ npm link
$ cd /tmp
$ ng new ngclitest
$ cd ngclitest
$ ng test  # shows error
$ ng build # shows error

Workaround:

$ cd ngclitest # inside newly built project
$ npm i glob
$ ng test  # no error
$ ng build # no error

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
cgmartincommented, Apr 21, 2016

Aha! I did not expect that the globally installed (linked) command would require from the local project dependency context. That seems odd to me, but thank you!

1reaction
Broccocommented, Apr 21, 2016

glob was a dev dependency but has been moved to be a full dependency. This will be in the next release, you can find the correcting commit here

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot find module 'glob' - npm - Stack Overflow
ng new ponyracer : This command will create a project named ponyracer (a folder named ponyracer with all the set up in it)....
Read more >
Cannot find module 'glob-all' [#3166807] | Drupal.org
Proposed resolution. Ensure that 'glob-all' is added as a dependency. Remaining tasks. User interface changes. API changes. Data ...
Read more >
error ts2307: cannot find module or its corresponding type ...
But when I try to import the newly generated parser I get the following error: TS2307: Cannot find module 'my-parser-generator' or its corresponding...
Read more >
Features | Vite
Glob Import #. Vite supports importing multiple modules from the file system via the special import.meta.glob function: js
Read more >
ansible.builtin.find module – Return a list of files based on ...
In most cases, you can use the short module name find even without specifying ... New in Ansible 2.0. Synopsis. Parameters. Attributes. See...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found