我在我的macOS 10.12.1上做了:
sudo npm install -g angular-cli@latest
然后
ng new testing-angular
和bum!
Cannot find module '/Users/USER/Downloads/config/environment'
Error: Cannot find module '/Users/USER/Downloads/config/environment'
at Function.Module._resolveFilename (module.js:455:15)
at Function.Module._load (module.js:403:25)
at Module.require (module.js:483:17)
at require (internal/module.js:20:19)
at Project.require (/usr/local/lib/node_modules/angular-cli/angular-cli/lib/models/project.js:280:12)
at Project.config (/usr/local/lib/node_modules/angular-cli/angular-cli/lib/models/project.js:198:26)
at Class.Blueprint.install (/usr/local/lib/node_modules/angular-cli/angular-cli/lib/models/blueprint.js:498:32)
at Class.run (/usr/local/lib/node_modules/angular-cli/angular-cli/lib/tasks/install-blueprint.js:53:24)
at Class.run (/usr/local/lib/node_modules/angular-cli/commands/init.js:105:33)
at tryCatch (/usr/local/lib/node_modules/angular-cli/node_modules/rsvp/dist/rsvp.js:538:12)
at invokeCallback (/usr/local/lib/node_modules/angular-cli/node_modules/rsvp/dist/rsvp.js:553:13)
at publish (/usr/local/lib/node_modules/angular-cli/node_modules/rsvp/dist/rsvp.js:521:7)
at flush (/usr/local/lib/node_modules/angular-cli/node_modules/rsvp/dist/rsvp.js:2373:5)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
当我在我的家庭目录中执行相同的ng new testing-angular
时,我没有收到任何错误。
知道我为什么会收到此错误以及如何避免错误?