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

ng new issue

Open harishajdarevic opened this issue 10 years ago • 34 comments

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 --version and 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.

harishajdarevic avatar Oct 28 '16 19:10 harishajdarevic

Hey all, first off apologies for the disruption caused.

This should now be fixed on beta19-3 and related subpackages:

kamik@T460p MINGW64 /D/sandbox
$ npm uninstall -g angular-cli && npm cache clean && npm install -g angular-cli
(...)
kamik@T460p MINGW64 /D/sandbox
$ ng -v
angular-cli: 1.0.0-beta.19-3
node: 6.5.0
os: win32 x64

Please let me know if you're still experiencing problems.

filipesilva avatar Oct 28 '16 21:10 filipesilva

Possible workaround I just upgraded with these versions:

  • angular-cli: 1.0.0-beta.19-3
  • node: 6.7.0
  • macOS Sierra v10.12.1
  • angular v2.1.2

using these steps from within my project folder:

  • sudo npm uninstall -g angular-cli
  • sudo npm cache clean
  • sudo npm install -g angular-cli@latest
  • rm -rf node_modules dist tmp
  • npm install --save-dev angular-cli@latest
  • npm install

then ran:

  • ng --version

and got the error: Cannot find module '@angular-cli/ast-tools'

I then repeated these steps:

  • rm -rf node_modules dist tmp
  • npm install

then ran:

  • ng --version

and error doesn't appear any more

Mufasa avatar Oct 28 '16 21:10 Mufasa

I also would like to say that the several detailed reports were very helpful, they really helped us narrow down what was wrong and give this issue the attention it needed. Thank you all!

filipesilva avatar Oct 28 '16 21:10 filipesilva

@filipesilva - Please see my comment two above as I reproduced the issue with beta.19-3 but have a workaround for it that may help identify what is causing it.

Mufasa avatar Oct 28 '16 21:10 Mufasa

on project dir: npm unlink angular-cli on a dir without node_modules: npm unlink angular-cli -g (the laters probablly not related with the solution of this problem..) npm uninstall -g angular-cli && npm cache clean && npm install -g angular-cli back to proj dir: npm install ng version -> ok ng serve -> perfect. (and I was hearing DJ Shadow - Building steam with a grain of salt. I'm sure this is the major factor for the solution)

filipemoraisjorge avatar Oct 28 '16 21:10 filipemoraisjorge

@Mufasa that was probably just a question of timing: there was a period of time (maybe 20mins) where 1.0.0-beta.19-3 was out but the subpackages (@angular-cli/ast-tools, @angular-cli/base-href-webpack and @ngtools/webpack) were not out yet. At the moment all should be updated.

filipesilva avatar Oct 28 '16 21:10 filipesilva

@filipesilva 1.0.0-beta.19-3 works. Thank you!


@filipesilva why beta.19-x instead of beta.20 ?

castamir avatar Oct 28 '16 22:10 castamir

Got it working 1.0.0-beta.19-3! Many thx for fix [tipping hat to ng2 team]

brendanalexdr avatar Oct 28 '16 22:10 brendanalexdr

Working great for me after upgrading to 1.0.0-beta.19-3.

Gotta love the community involvement here, and the speed at which this issue was resolved! Kudos to all that helped solve the issue.

mleanos avatar Oct 28 '16 22:10 mleanos

@castamir usually beta.X-Y releases are due to a problem in the release itself, not the code. They are essentially re-releases. We try to avoid them, but sometimes it happens. I think it was the second time we had to do it in over 50 releases.

filipesilva avatar Oct 28 '16 22:10 filipesilva

Thank you for the quick response on this. All working now, including e2e. The chromedriver issue has been fixed. Good job.

WilliamsSimonP avatar Oct 28 '16 22:10 WilliamsSimonP

@filipesilva it happens to everyone. I've just asked about naming convention, that's all. Thanks for answer.

Note about "re-release" in CHANGELOG would be nice.

castamir avatar Oct 28 '16 22:10 castamir

@filipesilva

Thank you guys. It works now.

For my case fix is:


npm uninstall -g angular-cli
npm uninstall -g angular-cli/ast-tools
npm uninstall -g angular-cli/base-href-webpack
npm cache clean
npm install -g angular-cli@latest

and finally: ng new testapp then: It works :)

harishajdarevic avatar Oct 29 '16 05:10 harishajdarevic

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.