angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Cannot find module '@angular-cli/ast-tools'

Open kevinaud opened this issue 10 years ago • 22 comments

Please provide us with the following information:

OS?

Linux, Fedora 23 Node 6.6.0 npm 3.10.3

Versions.

Version 1.0.0-beta.18

Repro steps.

mkdir test cd test npm install [email protected] ng new test-app

The log given by the failure.

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. (/home/kevinaud/bin/test/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. (/home/kevinaud/bin/test/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. (/home/kevinaud/bin/test/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. (/home/kevinaud/bin/test/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. (/home/kevinaud/bin/test/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/kevinaud/bin/test/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/kevinaud/bin/test/node_modules/angular-cli/addon/index.js:21:16) at /home/kevinaud/bin/test/node_modules/angular-cli/lib/models/project.js:392:61 at Array.forEach (native) at Project.addonCommands (/home/kevinaud/bin/test/node_modules/angular-cli/lib/models/project.js:391:15) at Project.eachAddonCommand (/home/kevinaud/bin/test/node_modules/angular-cli/lib/models/project.js:426:30) at module.exports (/home/kevinaud/bin/test/node_modules/angular-cli/lib/cli/lookup-command.js:33:13) at CLI. (/home/kevinaud/bin/test/node_modules/angular-cli/lib/cli/cli.js:34:26) at tryCatch (/home/kevinaud/bin/test/node_modules/rsvp/dist/rsvp.js:538:12) at invokeCallback (/home/kevinaud/bin/test/node_modules/rsvp/dist/rsvp.js:553:13) at publish (/home/kevinaud/bin/test/node_modules/rsvp/dist/rsvp.js:521:7) at flush (/home/kevinaud/bin/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)

Mention any other details that might be useful.

Was working fine yesterday. Today I tried to deploy the app I've been working on with my travis CI build and that's when I first encountered this error. When I tried to reproduce it at the most basic level on my own machine it gave me the same error. I'm not sure what could've changed since I had to version locked in to 1.0.0-beta.18. I have the angular cli globally installed on my machine at version 18 as well and it is working fine. It's only when I try to install it locally to a directory that I am running in to this.

kevinaud avatar Oct 28 '16 20:10 kevinaud

me too, except i am trying to use beta.19

brendanalexdr avatar Oct 28 '16 20:10 brendanalexdr

+1

karbica avatar Oct 28 '16 20:10 karbica

same problem with both beta.18 and beta.19 (ubuntu 16.04)

fcrocce avatar Oct 28 '16 20:10 fcrocce

Am getting the following while doing npm install angular-cli -g

[email protected] install C:\Users\User\AppData\Roaming\npm\node_modules\angular-cli\node_modules\execSync node install.js

[execsync v1.0.2] Attempting to compile native extensions. { Error: spawn node-gyp ENOENT at exports._errnoException (util.js:1026:11) at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32) at onErrorNT (internal/child_process.js:359:16) at _combinedTickCallback (internal/process/next_tick.js:74:11) at process._tickCallback (internal/process/next_tick.js:98:9) at Module.runMain (module.js:606:11) at run (bootstrap_node.js:394:7) at startup (bootstrap_node.js:149:9) at bootstrap_node.js:509:3 code: 'ENOENT', errno: 'ENOENT', syscall: 'spawn node-gyp', path: 'node-gyp', spawnargs: [ 'rebuild' ] } [execSync v1.0.2] Native code compile failed!! Will try to use win32 extension.

[email protected] install C:\Users\User\AppData\Roaming\npm\node_modules\angular-cli\node_modules\node-zopfli node-pre-gyp install --fallback-to-build

brendanalexdr avatar Oct 28 '16 20:10 brendanalexdr

+1 v1.0.0-beta.19

Blah2014 avatar Oct 28 '16 20:10 Blah2014

Same here ...

alexverdaguer avatar Oct 28 '16 20:10 alexverdaguer

Duplicate of #2940

sgybas avatar Oct 28 '16 20:10 sgybas

same here after a npm i -g angular-cli@latest

maybe the same as this https://github.com/angular/angular-cli/issues/1882#issuecomment-243311081

filipemoraisjorge avatar Oct 28 '16 20:10 filipemoraisjorge

+1 v1.0.0-beta.19

baschte avatar Oct 28 '16 20:10 baschte

+1 [email protected]

agalazis avatar Oct 28 '16 21:10 agalazis

Same problem setting up project on a fresh dev machine.

$ 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)

siouxfallsit avatar Oct 28 '16 21:10 siouxfallsit

Same here using latest:

Cannot find module '@angular-cli/ast-tools' Error: Cannot find module '@angular-cli/ast-tools' at Function.Module._resolveFilename (module.js:472:15) at Function.Module._load (module.js:420:25) at Module.require (module.js:500:17) at require (internal/module.js:20:19)

kreadiv avatar Oct 28 '16 21:10 kreadiv

For me it has messed up every version since beta 16. Beta 15 gives me a different error, but betas 16, 17, 18, and 19-2 give me the ast-tools issue

I'm thinking it must be an issue with a recently-updated dependency that's marked as ^ in the angular-cli's own package.json, because the issue happens when you npm install even to a previous version

RyanFromQA avatar Oct 28 '16 21:10 RyanFromQA

New version 1.0.0-beta.19-3 did not fix it. ( node 7.0.0 / npm 4.0.1 / macOS Sierra v.10.12.1 )

Error: Cannot find module '@angular-cli/ast-tools'
    at Function.Module._resolveFilename (module.js:472:15)
    at Function.Module._load (module.js:420:25)
    at Module.require (module.js:500:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/usr/local/lib/node_modules/angular-cli/utilities/ast-utils.js:4:19)

roelver avatar Oct 28 '16 21:10 roelver

Seeing the same Ubuntu 16.04,

node v6.9.1 npm 3.10.8

Tried reverting the previous version of angular-cli and clean install of both global and project node packages still seeing the same error

SamD avatar Oct 28 '16 21:10 SamD

worked for me at 10am this morning (PST) on new project, but broke this afternoon (2PM) when I deleted node_modules/ folder and re-ran npm install again (app that uses angular-cli, which is globally installed).

adumesny avatar Oct 28 '16 21:10 adumesny

Run again npm install -g angular-cli it's now working

leofachetti avatar Oct 28 '16 21:10 leofachetti

Dupe of https://github.com/angular/angular-cli/issues/2941, there's more information there.

filipesilva avatar Oct 28 '16 22:10 filipesilva

I had the same issue, turns out I had accidentally also installed angular-cli locally, and it wasn't using the global install.

after-ephemera avatar Oct 30 '16 06:10 after-ephemera

@filipesilva You closed as dupe but you marked the issue as dupe of itself.

Supamiu avatar Nov 02 '16 13:11 Supamiu