ng new issue
Please provide us with the following information:
OS?
Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?) Linux Ubuntu 16.04 LTS 64x
Versions.
Please run
ng --version. If there's nothing outputted, please run in a Terminal:node --versionand paste the result here: ng --version outputs Cannot find module '@angular-cli/base-href-webpack'
but npm list -g -depth=0 output: /home/haris/.nvm/versions/node/v6.7.0/lib ├── @angular-cli/[email protected] ├── [email protected] └── [email protected]
Repro steps.
Was this an app that wasn't created using the CLI? What change did you do on your code? etc.
# Global package:
npm uninstall -g angular-cli
npm cache clean
npm install -g angular-cli@latest
ng new test
result:
Cannot find module '@angular-cli/ast-tools'
The log given by the failure.
Normally this include a stack trace and some more information. Cannot find module '@angular-cli/base-href-webpack' Error: Cannot find module '@angular-cli/base-href-webpack' 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 Object.
(/home/haris/development/Vjezbanje/node_modules/angular-cli/models/webpack-build-common.js:7:27) at Module._compile (module.js:556:32) at Object.Module._extensions..js (module.js:565:10) at Module.load (module.js:473:32) at tryModuleLoad (module.js:432:12) at Function.Module._load (module.js:424:3) at Module.require (module.js:483:17) at require (internal/module.js:20:19) at Object. (/home/haris/development/Vjezbanje/node_modules/angular-cli/models/index.js:5:10) at Module._compile (module.js:556:32) at Object.Module._extensions..js (module.js:565:10) at Module.load (module.js:473:32) at tryModuleLoad (module.js:432:12) at Function.Module._load (module.js:424:3) at Module.require (module.js:483:17) at require (internal/module.js:20:19) at Object. (/home/haris/development/Vjezbanje/node_modules/angular-cli/models/webpack-config.js:4:10) at Module._compile (module.js:556:32) at Object.Module._extensions..js (module.js:565:10) at Module.load (module.js:473:32) at tryModuleLoad (module.js:432:12) at Function.Module._load (module.js:424:3) at Module.require (module.js:483:17) at require (internal/module.js:20:19) at Object. (/home/haris/development/Vjezbanje/node_modules/angular-cli/tasks/build-webpack.js:6:24) at Module._compile (module.js:556:32) at Object.Module._extensions..js (module.js:565:10) at Module.load (module.js:473:32) at tryModuleLoad (module.js:432:12) at Function.Module._load (module.js:424:3) at Module.require (module.js:483:17) at require (internal/module.js:20:19) at Object. (/home/haris/development/Vjezbanje/node_modules/angular-cli/commands/build.js:3:23) at Module._compile (module.js:556:32) at Object.Module._extensions..js (module.js:565:10) at Module.load (module.js:473:32) at tryModuleLoad (module.js:432:12) at Function.Module._load (module.js:424:3) at Module.require (module.js:483:17) at require (internal/module.js:20:19) at Class.includedCommands (/home/haris/development/Vjezbanje/node_modules/angular-cli/addon/index.js:20:16) at /home/haris/development/Vjezbanje/node_modules/angular-cli/lib/models/project.js:392:61 at Array.forEach (native) at Project.addonCommands (/home/haris/development/Vjezbanje/node_modules/angular-cli/lib/models/project.js:391:15) at Project.eachAddonCommand (/home/haris/development/Vjezbanje/node_modules/angular-cli/lib/models/project.js:426:30) at module.exports (/home/haris/development/Vjezbanje/node_modules/angular-cli/lib/cli/lookup-command.js:33:13) at CLI. (/home/haris/development/Vjezbanje/node_modules/angular-cli/lib/cli/cli.js:34:26) at tryCatch (/home/haris/development/Vjezbanje/node_modules/rsvp/dist/lib/rsvp/-internal.js:215:12) at invokeCallback (/home/haris/development/Vjezbanje/node_modules/rsvp/dist/lib/rsvp/-internal.js:230:13) at publish (/home/haris/development/Vjezbanje/node_modules/rsvp/dist/lib/rsvp/-internal.js:198:7) at flush (/home/haris/development/Vjezbanje/node_modules/rsvp/dist/lib/rsvp/asap.js:85:5) at _combinedTickCallback (internal/process/next_tick.js:67:7) at process._tickCallback (internal/process/next_tick.js:98:9)
Mention any other details that might be useful.
I tried to install base-href-pack and here it is: /home/haris/.nvm/versions/node/v6.7.0/lib ├── @angular-cli/[email protected] ├── @angular-cli/[email protected] ├── [email protected] └── [email protected]
but that also didn't help
Thanks! We'll be in touch soon.
Maybe similar, I get this with beta.19-2:
$ node_modules/.bin/ng --version
Cannot find module '@angular-cli/ast-tools'
Error: Cannot find module '@angular-cli/ast-tools'
at Function.Module._resolveFilename (module.js:469:15)
Get the same:
Cannot find module '@angular-cli/ast-tools
@achimha getting the same with a fresh install of 1.0.0-beta.18
$ ng --version
Cannot find module '@angular-cli/ast-tools'
Error: Cannot find module '@angular-cli/ast-tools'
at Function.Module._resolveFilename (module.js:455:15)
I know I give this answer a lot, but it's only because the procedure is there for a reason. There are many npm problems you can get if you don't follow the procedure.
Make absolutely sure you're following https://github.com/angular/angular-cli#updating-angular-cli, follow all steps, don't skip any of them.
# Global package:
npm uninstall -g angular-cli
npm cache clean
npm install -g angular-cli@latest
Local project package:
# Local project package:
rm -rf node_modules dist tmp
npm install --save-dev angular-cli@latest
npm install
ng init
Also make sure that the folder where you're running commands doesn't have a node_modules up in the directory tree, as that can cause commands to use a angular-cli version in that folder instead.
If I take an old project's @angular-cli, angular-cli, and @ngtools folder, and paste them into my current projects node_modules folder, it works fine. Hmm.. here's a diff of the @angular-cli folders
diff -rw node_modules/@angular-cli/ast-tools/node_modules/rxjs/package.json /Users/unknown_user/Development/projects/cyhy-web-angular/node_modules/@angular-cli/ast-tools/node_modules/rxjs/package.json
13c13
< "/Users/unknown_user/Development/play/broken/node_modules/@angular-cli/ast-tools"
---
> "/Users/unknown_user/Development/play/imports/node_modules/@angular-cli/ast-tools"
48c48
< "_where": "/Users/unknown_user/Development/play/broken/node_modules/@angular-cli/ast-tools",
---
> "_where": "/Users/unknown_user/Development/play/imports/node_modules/@angular-cli/ast-tools",
diff -rw node_modules/@angular-cli/ast-tools/package.json /Users/unknown_user/Development/projects/cyhy-web-angular/node_modules/@angular-cli/ast-tools/package.json
13c13
< "/Users/unknown_user/Development/play/broken/node_modules/angular-cli"
---
> "/Users/unknown_user/Development/play/imports/node_modules/angular-cli"
17c17
< "_id": "@angular-cli/[email protected]",
---
> "_id": "@angular-cli/[email protected]",
21c21
< "_nodeVersion": "5.5.0",
---
> "_nodeVersion": "5.12.0",
24c24
< "tmp": "tmp/ast-tools-1.0.6.tgz_1477669524435_0.826947646215558"
---
> "tmp": "tmp/ast-tools-1.0.5.tgz_1477001030955_0.23042994225397706"
30c30
< "_npmVersion": "3.5.3",
---
> "_npmVersion": "3.8.6",
47,48c47,48
< "_resolved": "https://registry.npmjs.org/@angular-cli/ast-tools/-/ast-tools-1.0.6.tgz",
< "_shasum": "b5d550ca222bca690245265e29f75a65732b0cba",
---
> "_resolved": "https://registry.npmjs.org/@angular-cli/ast-tools/-/ast-tools-1.0.5.tgz",
> "_shasum": "2eec035d6583291fe88f716e69ee0ca169fe7d9e",
51c51
< "_where": "/Users/unknown_user/Development/play/broken/node_modules/angular-cli",
---
> "_where": "/Users/unknown_user/Development/play/imports/node_modules/angular-cli",
68,69c68,69
< "shasum": "b5d550ca222bca690245265e29f75a65732b0cba",
< "tarball": "https://registry.npmjs.org/@angular-cli/ast-tools/-/ast-tools-1.0.6.tgz"
---
> "shasum": "2eec035d6583291fe88f716e69ee0ca169fe7d9e",
> "tarball": "https://registry.npmjs.org/@angular-cli/ast-tools/-/ast-tools-1.0.5.tgz"
98c98
< "version": "1.0.6"
---
> "version": "1.0.5"
Only in /Users/unknown_user/Development/projects/cyhy-web-angular/node_modules/@angular-cli/ast-tools/src: ast-utils.d.ts
Only in /Users/unknown_user/Development/projects/cyhy-web-angular/node_modules/@angular-cli/ast-tools/src: ast-utils.js
Only in /Users/unknown_user/Development/projects/cyhy-web-angular/node_modules/@angular-cli/ast-tools/src: ast-utils.js.map
Only in node_modules/@angular-cli/ast-tools/src: ast-utils.spec.ts
Only in node_modules/@angular-cli/ast-tools/src: ast-utils.ts
Only in /Users/unknown_user/Development/projects/cyhy-web-angular/node_modules/@angular-cli/ast-tools/src: change.d.ts
Only in /Users/unknown_user/Development/projects/cyhy-web-angular/node_modules/@angular-cli/ast-tools/src: change.js
Only in /Users/unknown_user/Development/projects/cyhy-web-angular/node_modules/@angular-cli/ast-tools/src: change.js.map
Only in node_modules/@angular-cli/ast-tools/src: change.spec.ts
Only in node_modules/@angular-cli/ast-tools/src: change.ts
Only in /Users/unknown_user/Development/projects/cyhy-web-angular/node_modules/@angular-cli/ast-tools/src: index.d.ts
Only in /Users/unknown_user/Development/projects/cyhy-web-angular/node_modules/@angular-cli/ast-tools/src: index.js
Only in /Users/unknown_user/Development/projects/cyhy-web-angular/node_modules/@angular-cli/ast-tools/src: index.js.map
Only in node_modules/@angular-cli/ast-tools/src: index.ts
Only in /Users/unknown_user/Development/projects/cyhy-web-angular/node_modules/@angular-cli/ast-tools/src: node.d.ts
Only in /Users/unknown_user/Development/projects/cyhy-web-angular/node_modules/@angular-cli/ast-tools/src: node.js
Only in /Users/unknown_user/Development/projects/cyhy-web-angular/node_modules/@angular-cli/ast-tools/src: node.js.map
Only in node_modules/@angular-cli/ast-tools/src: node.ts
Only in /Users/unknown_user/Development/projects/cyhy-web-angular/node_modules/@angular-cli/ast-tools/src: route-utils.d.ts
Only in /Users/unknown_user/Development/projects/cyhy-web-angular/node_modules/@angular-cli/ast-tools/src: route-utils.js
Only in /Users/unknown_user/Development/projects/cyhy-web-angular/node_modules/@angular-cli/ast-tools/src: route-utils.js.map
Only in node_modules/@angular-cli/ast-tools/src: route-utils.spec.ts
Only in node_modules/@angular-cli/ast-tools/src: route-utils.ts
Only in /Users/unknown_user/Development/projects/cyhy-web-angular/node_modules/@angular-cli/ast-tools/src: spec-utils.d.ts
Only in /Users/unknown_user/Development/projects/cyhy-web-angular/node_modules/@angular-cli/ast-tools/src: spec-utils.js
Only in /Users/unknown_user/Development/projects/cyhy-web-angular/node_modules/@angular-cli/ast-tools/src: spec-utils.js.map
Only in node_modules/@angular-cli/ast-tools/src: spec-utils.ts
Only in node_modules/@angular-cli/ast-tools: tsconfig.json
diff -rw node_modules/@angular-cli/base-href-webpack/package.json /Users/unknown_user/Development/projects/cyhy-web-angular/node_modules/@angular-cli/base-href-webpack/package.json
13c13
< "/Users/unknown_user/Development/play/broken/node_modules/angular-cli"
---
> "/Users/unknown_user/Development/play/imports/node_modules/angular-cli"
17c17
< "_id": "@angular-cli/[email protected]",
---
> "_id": "@angular-cli/[email protected]",
21c21
< "_nodeVersion": "5.5.0",
---
> "_nodeVersion": "5.12.0",
24c24
< "tmp": "tmp/base-href-webpack-1.0.5.tgz_1477669535915_0.7465789108537138"
---
> "tmp": "tmp/base-href-webpack-1.0.4.tgz_1477001044450_0.3589182198047638"
30c30
< "_npmVersion": "3.5.3",
---
> "_npmVersion": "3.8.6",
44,45c44,45
< "_resolved": "https://registry.npmjs.org/@angular-cli/base-href-webpack/-/base-href-webpack-1.0.5.tgz",
< "_shasum": "3719fac7a0339e0258469c63ac5431211b0a508b",
---
> "_resolved": "https://registry.npmjs.org/@angular-cli/base-href-webpack/-/base-href-webpack-1.0.4.tgz",
> "_shasum": "39506dbbab0f7a974e1ce980fe90b10cf8e73e9f",
48c48
< "_where": "/Users/unknown_user/Development/play/broken/node_modules/angular-cli",
---
> "_where": "/Users/unknown_user/Development/play/imports/node_modules/angular-cli",
60,61c60,61
< "shasum": "3719fac7a0339e0258469c63ac5431211b0a508b",
< "tarball": "https://registry.npmjs.org/@angular-cli/base-href-webpack/-/base-href-webpack-1.0.5.tgz"
---
> "shasum": "39506dbbab0f7a974e1ce980fe90b10cf8e73e9f",
> "tarball": "https://registry.npmjs.org/@angular-cli/base-href-webpack/-/base-href-webpack-1.0.4.tgz"
87c87
< "version": "1.0.5"
---
> "version": "1.0.4"
Only in /Users/unknown_user/Development/projects/cyhy-web-angular/node_modules/@angular-cli/base-href-webpack/src: base-href-webpack-plugin.d.ts
Only in /Users/unknown_user/Development/projects/cyhy-web-angular/node_modules/@angular-cli/base-href-webpack/src: base-href-webpack-plugin.js
Only in /Users/unknown_user/Development/projects/cyhy-web-angular/node_modules/@angular-cli/base-href-webpack/src: base-href-webpack-plugin.js.map
Only in node_modules/@angular-cli/base-href-webpack/src: base-href-webpack-plugin.spec.ts
Only in node_modules/@angular-cli/base-href-webpack/src: base-href-webpack-plugin.ts
Only in /Users/unknown_user/Development/projects/cyhy-web-angular/node_modules/@angular-cli/base-href-webpack/src: index.d.ts
Only in /Users/unknown_user/Development/projects/cyhy-web-angular/node_modules/@angular-cli/base-href-webpack/src: index.js
Only in /Users/unknown_user/Development/projects/cyhy-web-angular/node_modules/@angular-cli/base-href-webpack/src: index.js.map
Only in node_modules/@angular-cli/base-href-webpack/src: index.ts
Only in node_modules/@angular-cli/base-href-webpack: tsconfig.json
I'm getting this issue in my travis CI deployment which I assume has a totally clean version of npm on it so I don't think that cleaning the cache or reinstalling the angular-cli will fix this.
I just did the following
➜ ~ npm uninstall -g angular-cli
➜ ~ npm cache clean
➜ ~ npm install -g angular-cli@latest
result:
➜ ~ ng -v
Cannot find module '@angular-cli/ast-tools'
Error: Cannot find module '@angular-cli/ast-tools'
....
I agree! Does not work. We had the same issue in the past. ast-tools was not published was the solution.
See https://github.com/angular/angular-cli/issues/1882
Should these files be compiled to js?
➜ src git:(master) pwd /usr/local/lib/node_modules/angular-cli/node_modules/@angular-cli/ast-tools/src
➜ src git:(master) ll
total 208
-rw-r--r-- 1 johnlong admin 9.0K Oct 1 17:20 ast-utils.spec.ts
-rw-r--r-- 1 johnlong admin 10K Oct 1 17:20 ast-utils.ts
-rw-r--r-- 1 johnlong admin 4.6K Oct 1 17:20 change.spec.ts
-rw-r--r-- 1 johnlong admin 4.9K Oct 1 17:20 change.ts
-rw-r--r-- 1 johnlong admin 110B Sep 26 22:36 index.ts
-rw-r--r-- 1 johnlong admin 1.0K Aug 28 16:55 node.ts
-rw-r--r-- 1 johnlong admin 25K Oct 1 17:20 route-utils.spec.ts
-rw-r--r-- 1 johnlong admin 21K Oct 1 17:20 route-utils.ts
-rw-r--r-- 1 johnlong admin 690B Aug 28 16:55 spec-utils.ts
Here are my steps (Mac OS X 10.11.6):
Uninstall Angular CLI:
npm uninstall -g angular-cli
npm cache clean
Uninstall Node:
brew uninstall node;
brew prune;
rm -f /usr/local/bin/npm;
rm -f /usr/local/bin/node;
rm -f /usr/local/lib/dtrace/node.d;
rm -rf /usr/local/lib/node_modules
rm -rf ~/.npm;
Install Node 6 LTS
brew tap homebrew/homebrew-versions
brew install node6-lts
brew link --overwrite node6-lts
Install Angular-CLI
npm install -g angular-cli
Hold breath:
ng version
Error: Cannot find module '@angular-cli/ast-tools'
Here are my steps to reproduce issue on Windows 10 @filipesilva:
# Global package:
npm uninstall -g angular-cli
npm cache clean
npm install -g angular-cli@latest
# Local project package:
rm -rf node_modules dist tmp
npm install --save-dev angular-cli@latest
npm install
Then this:
ng init
**Error: Cannot find module @angular-cli/ast-tools**
Following the global package steps from @filipesilva didn't solve the issue for me either.
Windows 10 NPM: v3.10.7 Node: v6.6.0
After successful uninstall, cache clean, and install lastest..
ng --help
Cannot find module '@angular-cli/ast-tools'
Error: Cannot find module '@angular-cli/ast-tools'
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 Object.<anonymous> (C:\Program Files\nodejs\node_modules\angular-cli\utilities\ast-utils.js:4:19)
at Module._compile (module.js:556:32)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
at Module.require (module.js:483:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (C:\Program Files\nodejs\node_modules\angular-cli\models\find-lazy-modules.js:7:19)
at Module._compile (module.js:556:32)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
at Module.require (module.js:483:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (C:\Program Files\nodejs\node_modules\angular-cli\models\webpack-build-typescript.js:4:27)
at Module._compile (module.js:556:32)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
at Module.require (module.js:483:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (C:\Program Files\nodejs\node_modules\angular-cli\models\webpack-config.js:2:34)
at Module._compile (module.js:556:32)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
at Module.require (module.js:483:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (C:\Program Files\nodejs\node_modules\angular-cli\tasks\build-webpack.js:6:24)
at Module._compile (module.js:556:32)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
at Module.require (module.js:483:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (C:\Program Files\nodejs\node_modules\angular-cli\commands\build.js:3:23)
at Module._compile (module.js:556:32)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
at Module.require (module.js:483:17)
at require (internal/module.js:20:19)
at Class.includedCommands (C:\Program Files\nodejs\node_modules\angular-cli\addon\index.js:21:16)
at C:\Program Files\nodejs\node_modules\angular-cli\node_modules\angular-cli\lib\models\project.js:392:61
at Array.forEach (native)
at Project.addonCommands (C:\Program Files\nodejs\node_modules\angular-cli\node_modules\angular-cli\lib\models\project.js:391:15)
at Project.eachAddonCommand (C:\Program Files\nodejs\node_modules\angular-cli\node_modules\angular-cli\lib\models\project.js:426:30)
at module.exports (C:\Program Files\nodejs\node_modules\angular-cli\node_modules\angular-cli\lib\cli\lookup-command.js:33:13)
at CLI.<anonymous> (C:\Program Files\nodejs\node_modules\angular-cli\node_modules\angular-cli\lib\cli\cli.js:34:26)
at tryCatch (C:\Program Files\nodejs\node_modules\angular-cli\node_modules\rsvp\dist\rsvp.js:538:12)
at invokeCallback (C:\Program Files\nodejs\node_modules\angular-cli\node_modules\rsvp\dist\rsvp.js:553:13)
at publish (C:\Program Files\nodejs\node_modules\angular-cli\node_modules\rsvp\dist\rsvp.js:521:7)
at flush (C:\Program Files\nodejs\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)
Mac OSX 10.11.6 Node v6.9.0 npm v3.10.8 angular-cli v1.0.0-beta.18 (global and local)
I initialized a new app from global with no issues (ng new my-app-name --style=scss), but then tried to serve the new app and encountered the error:
ng serve
Cannot find module '@angular-cli/ast-tools'
Error: Cannot find module '@angular-cli/ast-tools'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/kimmaida-auth0/Documents/Auth0/TESTING GROUND/ng2-dinos-test/node_modules/angular-cli/utilities/ast-utils.js:4:19)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/kimmaida-auth0/Documents/Auth0/TESTING GROUND/ng2-dinos-test/node_modules/angular-cli/models/find-lazy-modules.js:7:19)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/kimmaida-auth0/Documents/Auth0/TESTING GROUND/ng2-dinos-test/node_modules/angular-cli/models/webpack-build-typescript.js:4:27)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/kimmaida-auth0/Documents/Auth0/TESTING GROUND/ng2-dinos-test/node_modules/angular-cli/models/webpack-config.js:2:34)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/kimmaida-auth0/Documents/Auth0/TESTING GROUND/ng2-dinos-test/node_modules/angular-cli/tasks/build-webpack.js:6:24)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/kimmaida-auth0/Documents/Auth0/TESTING GROUND/ng2-dinos-test/node_modules/angular-cli/commands/build.js:3:23)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Class.includedCommands (/Users/kimmaida-auth0/Documents/Auth0/TESTING GROUND/ng2-dinos-test/node_modules/angular-cli/addon/index.js:21:16)
at /Users/kimmaida-auth0/Documents/Auth0/TESTING GROUND/ng2-dinos-test/node_modules/angular-cli/lib/models/project.js:392:61
at Array.forEach (native)
at Project.addonCommands (/Users/kimmaida-auth0/Documents/Auth0/TESTING GROUND/ng2-dinos-test/node_modules/angular-cli/lib/models/project.js:391:15)
at Project.eachAddonCommand (/Users/kimmaida-auth0/Documents/Auth0/TESTING GROUND/ng2-dinos-test/node_modules/angular-cli/lib/models/project.js:426:30)
at module.exports (/Users/kimmaida-auth0/Documents/Auth0/TESTING GROUND/ng2-dinos-test/node_modules/angular-cli/lib/cli/lookup-command.js:33:13)
at CLI.<anonymous> (/Users/kimmaida-auth0/Documents/Auth0/TESTING GROUND/ng2-dinos-test/node_modules/angular-cli/lib/cli/cli.js:34:26)
at tryCatch (/Users/kimmaida-auth0/Documents/Auth0/TESTING GROUND/ng2-dinos-test/node_modules/rsvp/dist/rsvp.js:538:12)
at invokeCallback (/Users/kimmaida-auth0/Documents/Auth0/TESTING GROUND/ng2-dinos-test/node_modules/rsvp/dist/rsvp.js:553:13)
at publish (/Users/kimmaida-auth0/Documents/Auth0/TESTING GROUND/ng2-dinos-test/node_modules/rsvp/dist/rsvp.js:521:7)
at flush (/Users/kimmaida-auth0/Documents/Auth0/TESTING GROUND/ng2-dinos-test/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)
I copied @angular-cli and @ngtools from a different Angular 2 project's node_modules folder (same CLI version) and pasted them into the new one and this fixed the local issue for me. Due to deadlines, I can't afford to upgrade my global installation and all local installations and risk everything breaking again at this time, but will be following this thread for a resolution and will upgrade when there is one. Thanks!
@filipesilva I followed your steps and end up with the following
Cannot find module '@angular-cli/ast-tools'
Error: Cannot find module '@angular-cli/ast-tools'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/markpoko/poko/my-project/node_modules/angular-cli/utilities/ast-utils.js:4:19)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/markpoko/poko/my-project/node_modules/angular-cli/models/find-lazy-modules.js:7:19)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/markpoko/poko/my-project/node_modules/angular-cli/models/webpack-build-typescript.js:4:27)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/markpoko/poko/my-project/node_modules/angular-cli/models/webpack-config.js:2:34)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/markpoko/poko/my-project/node_modules/angular-cli/tasks/build-webpack.js:6:24)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/markpoko/poko/my-project/node_modules/angular-cli/commands/build.js:3:23)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Class.includedCommands (/Users/markpoko/poko/my-project/node_modules/angular-cli/addon/index.js:21:16)
at /Users/markpoko/poko/my-project/node_modules/angular-cli/lib/models/project.js:392:61
at Array.forEach (native)
at Project.addonCommands (/Users/markpoko/poko/my-project/node_modules/angular-cli/lib/models/project.js:391:15)
at Project.eachAddonCommand (/Users/markpoko/poko/my-project/node_modules/angular-cli/lib/models/project.js:426:30)
at module.exports (/Users/markpoko/poko/my-project/node_modules/angular-cli/lib/cli/lookup-command.js:33:13)
at CLI.<anonymous> (/Users/markpoko/poko/my-project/node_modules/angular-cli/lib/cli/cli.js:34:26)
at tryCatch (/Users/markpoko/poko/my-project/node_modules/rsvp/dist/rsvp.js:538:12)
at invokeCallback (/Users/markpoko/poko/my-project/node_modules/rsvp/dist/rsvp.js:553:13)
at publish (/Users/markpoko/poko/my-project/node_modules/rsvp/dist/rsvp.js:521:7)
at flush (/Users/markpoko/poko/my-project/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)
I started working on a project ~5 hours ago and it worked fine. I went to start another project and ran ng new
One of the things I noticed is that none of the JS traspilations are available. The previous release they were packaged in NPM and didn't need to be transpiled.
I am getting this also. I have followed the upgrade instructions.
- [email protected]
- npm 3.10.9
- node 6.9.1
- Ubuntu 16.04
same issue, and I didn't even upgrade. I reverted to an old commit on beta.17, angular 2.0.2. Cleared my node_modules/ directory and did npm install. On node 4.4.7, npm 3.10.5.
Uninstall angular-cli globally as well, and using the ng within the project, via a npm script.
- [email protected]
- npm 3.10.9
- node 6.9.1
- Windows 10 64-bit
No upgrade here. Just created a new project, ng new and got the same errors. Was creating a test project to diagnose an issue with AngularFire2.
We've dug around a bit more and are able to reproduce. We're trying to fix this as soon as possible.
I just noticed that [email protected] is now latest. I tried it, following the upgrade process as detailed above, but it is giving the same problem.
Okay, I've got it working. Slightly updated update process. As well as deleting node_modules, dist and tmp, I had to delete ~/.npm. Luckily I am only working on a single nodeJS project on this machine and so this isn't a problem, but anyone who is developing multiple projects may need to think carefully before doing this.