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

Angular CLI App doesn't run after CLI update.

Open rajinder-yadav opened this issue 9 years ago • 8 comments

Please provide us with the following information:

OS?

linux 4.4.0-62-generic

Versions.

Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:

$ ng --version

                             _                           _  _
  __ _  _ __    __ _  _   _ | |  __ _  _ __         ___ | |(_)
 / _` || '_ \  / _` || | | || | / _` || '__|_____  / __|| || |
| (_| || | | || (_| || |_| || || (_| || |  |_____|| (__ | || |
 \__,_||_| |_| \__, | \__,_||_| \__,_||_|          \___||_||_|
               |___/
@angular/cli: 1.0.0-beta.31
node: 7.4.0
os: linux x64
@angular/common: 2.4.7
@angular/compiler: 2.4.7
@angular/core: 2.4.7
@angular/forms: 2.4.7
@angular/http: 2.4.7
@angular/platform-browser: 2.4.7
@angular/platform-browser-dynamic: 2.4.7
@angular/router: 3.4.7
@angular/compiler-cli: 2.4.7

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc.

Old app created using CLI doesn't start after CLI update and Angular update to v2.4.7 npm update --save

You can clone this sample-repo and update the app under folder input-output.

I've followed the steps on upgrading from the CLI site.

The log given by the failure.

Normally this include a stack trace and some more information.

input-output: master$ ng s
Cannot find module '@angular/compiler-cli'
Error: Cannot find module '@angular/compiler-cli'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/yadav/.nvm/versions/node/v7.4.0/lib/node_modules/@angular/cli/node_modules/@ngtools/webpack/src/plugin.js:5:24)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/yadav/.nvm/versions/node/v7.4.0/lib/node_modules/@angular/cli/node_modules/@ngtools/webpack/src/index.js:5:10)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/yadav/.nvm/versions/node/v7.4.0/lib/node_modules/@angular/cli/models/webpack-configs/typescript.js:4:19)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/yadav/.nvm/versions/node/v7.4.0/lib/node_modules/@angular/cli/models/webpack-configs/index.js:9:10)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/yadav/.nvm/versions/node/v7.4.0/lib/node_modules/@angular/cli/models/webpack-config.js:4:27)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/yadav/.nvm/versions/node/v7.4.0/lib/node_modules/@angular/cli/tasks/serve.js:10:26)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Class.run (/home/yadav/.nvm/versions/node/v7.4.0/lib/node_modules/@angular/cli/commands/serve.js:74:27)
    at Class.<anonymous> (/home/yadav/.nvm/versions/node/v7.4.0/lib/node_modules/@angular/cli/ember-cli/lib/models/command.js:134:17)
    at process._tickCallback (internal/process/next_tick.js:103:7)

Mention any other details that might be useful.


Thanks! We'll be in touch soon.

rajinder-yadav avatar Feb 13 '17 23:02 rajinder-yadav

i also face this issue try to install npm i --save @angular/compiler-cli and it works for me

ashjha avatar Feb 14 '17 06:02 ashjha

@rajinder-yadav If I understand correctly your app was created with a previous version of angular-cli, and now you've updated the global angular-cli version.

This issue happened to me, I fixed it by updating my local version of the cli:

rm -rf node_modules dist # use rmdir on Windows npm install --save-dev @angular/cli@latest npm install ng update

Good luck.

mikeeus avatar Feb 14 '17 13:02 mikeeus

I have also problems on app build with previous version ! I try to do :

rm -rf node_modules dist # use rmdir on Windows
npm install --save-dev @angular/cli@latest
npm install
ng update

I am using Windows 10 (32bits) node -v = v7.5.0 npm -v = 4.2.0 ng -v =

__ _  _ __    __ _  _   _ | |  __ _  _ __         ___ | |(_)
/ _` || '_ \  / _` || | | || | / _` || '__|_____  / __|| || |
| (_| || | | || (_| || |_| || || (_| || |  |_____|| (__ | || |
\__,_||_| |_| \__, | \__,_||_| \__,_||_|          \___||_||_|
              |___/
angular-cli: 1.0.0-beta.26
node: 7.5.0
os: win32 ia32
@angular/common: 2.4.7
@angular/compiler: 2.4.7
@angular/core: 2.4.7
@angular/forms: 2.4.7
@angular/http: 2.4.7
@angular/platform-browser: 2.4.7
@angular/platform-browser-dynamic: 2.4.7
@angular/router: 3.4.7
@angular/cli: 1.0.0-beta.31
@angular/compiler-cli: 2.4.7

when i type ng serve : You have to be inside an angular-cli project in order to use the serve command.

ng update : The specified command update is invalid. For available options, see ng help.

bvaissade avatar Feb 14 '17 15:02 bvaissade

@bvaissade make sure you dont have angular-cli in devDependencies in your package.json, there should be only @angular/cli and then reinstall all packages with:

rm -rf node_modules
npm install

m0t0r avatar Feb 14 '17 16:02 m0t0r

OK I did the steps today on two older cli projects and things are working fine.

My initial issue has been resolved, I may have pooched something along the way last night!

To update CLI as well as update to Angular to 2.4.7 I did

rm -rf node_modules dist # use rmdir on Windows
npm install --save-dev @angular/cli@latest

npm update --save
npm update --save-dev
npm install

rajinder-yadav avatar Feb 14 '17 20:02 rajinder-yadav

Closing as resolved.

filipesilva avatar Mar 13 '17 16:03 filipesilva

thanks @mikeeus you saved me

samirasaly avatar Sep 03 '17 08:09 samirasaly

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.