I have installed Angular/cli and then try to run command ng serve then below error is throwing. I have tried lot of thing like uninstall angular/cli, npm cache clean, etc
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.
This may be a problem in not implicitly running devDependencies.
Try running them implicitly with the command below.
npm install --dev
Generic way out to escape this issue
Create a new project
ng new angular-seed
Copy all the default dependencies and dev-dependenices from package.json to your current project in use (angular, typescript, etc...)
Then remove node_modules and run install npm packages of your current project, or whatever method you use to reubild
rm -fr node_modules npm install
note: if this doesn't get you the latest version, then you may have global tools installed in roaming data
(in window explored browser type %appdata%
, and navigate to npm to observe)
npm install --only=dev
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With