Solvedangular cli ng serve not working when install latest version of angular cli

Please provide us with the following information:
windows 10

angular/cli: 1.0.0-beta.32.3 [1.0.0-beta.26]
node: 6.9.5
os: win32 x64
@angular/cli: 1.0.0-beta.32.3

nothing just upgraded to the new version and started having all these problems
also I get this error also
can't find @angular/platform-browser-dynamic


OS?

Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)

Versions.

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

Repro steps.

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

The log given by the failure.

Normally this include a stack trace and some more information.

Mention any other details that might be useful.


Thanks! We'll be in touch soon.

44 Answers

✔️Accepted Answer

Try these steps please:

Clean up

  • remove node_modules from your project
  • remove any angular-cli and @angular/cli references from package.json if it's there
  • Uninstall angular-cli and @angular/cli globally: npm uninstall -g angular-cli @angular/cli

Reinstall

  • Install @angular/cli globally: npm install -g @angular/cli
  • Install @angular/cli in your project: npm install --save-dev @angular/cli

Other Answers:

@khizerrehands You need to follow the environments portion of the angular-cli.json file just like it mentions in the error. Replace the environments property with these two.

"environmentSource": "environments/environment.ts",
"environments": {
  "dev": "environments/environment.ts",
  "prod": "environments/environment.prod.ts"
}

On a Windows 7, 64bit

rm -rf node_modules
npm install
ng serve

solved it. 🚀

Hi,

Found the solution. If you the error above still persist then try this:

open angular-cli.json
find-
"environments": {
"source": "environments/environment.ts",
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}

and replace with:
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}

@tedrob - sorry my comment came in as exact same time as @beeman.
I did not have a solution or good troubleshooting. Just figured that in my case (.26 -> 32.3), the new version has so many breaking changes that I may as well give up on the old project and have ngCLI build a new one, then transfer module code etc into that new project.
I apologize for confusing this thread.

I guess we cannot expect upgrade stability until we get to RC stage at least.

More Issues: