I was getting the same error when I tried to run "ng serve" after that I saw some suggetions one of the techie told me to update my npm.I did that as well then I got this screen after entering "ng server"
""Versions of @angular/compiler-cli and typescript could not be determined.
The most common reason for this is a broken npm install.
Please make sure your package.json contains both @angular/compiler-cli and typescript in devDependencies, then delete node_module and package-lock.json(if you have one) and
Run npm install again.""
After performing all the actions now its working correctly...and getting message "Compiled Successfully."
When both installs had successfully completed I ran npm serve and received an error saying
"Versions of @angular/compiler-cli and typescript could not be determined.
The most common reason for this is a broken npm install.
Please make sure your package.json contains both @angular/compiler-cli and typescript in
devDependencies, then delete node_modules and package-lock.json (if you have one) and
run npm install again."
I then deleted my node_modules folder as well as my package-lock.json folder.
After I deleted those folders I ran npm install --save once more.
I ran npm start and received another error. This error said Error: Cannot find module '@angular-devkit/core'.
I was getting the same error when I tried to run "ng serve" after that I saw some suggetions one of the techie told me to update my npm.I did that as well then I got this screen after entering "ng server"
""Versions of @angular/compiler-cli and typescript could not be determined. The most common reason for this is a broken npm install. Please make sure your package.json contains both @angular/compiler-cli and typescript in devDependencies, then delete node_module and package-lock.json(if you have one) and Run npm install again.""
After performing all the actions now its working correctly...and getting message "Compiled Successfully."
This is how I solved this problem.
I first ran
npm install @angular/core
.Then I ran
npm install --save
.When both installs had successfully completed I ran
npm serve
and received an error sayingI then deleted my node_modules folder as well as my package-lock.json folder.
After I deleted those folders I ran
npm install --save
once more.I ran
npm start
and received another error. This error saidError: Cannot find module '@angular-devkit/core'
.I ran
npm install @angular-devkit/core --save
.Finally, I ran
npm start
and the project started!the fix for me was
After trying to no avail:
npm install -g @angular/cli worked for me
I had the same issue and along with removing the node_modules and reinstalling I needed to remove package-lock.json first.
You need to run the ng server from the c:\project\angular-src location. Not just the root of your project.