Skip to content

Cannot find module 'glob' in newly generated project #492

@cgmartin

Description

@cgmartin

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 e5237f2
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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions