Unable to create a new angular project

Viewed 809

I am new to Angular and I am facing the following problem in creating a new project. I have already installed nodejs and npm which are the prerequisites of Angular. I also installed the angular CLI but when I am trying to create a new project the following error is coming.

[⠼ Installing packages...npm WARN deprecated request@2.88.2: request has been deprecated, see
npm WARN deprecated urix@0.1.0: Please see
npm WARN deprecated resolve-url@0.2.1
npm ERR! Unexpected end of JSON input while parsing near '...p":"^0.8.0","grunt-co'

npm ERR! A complete log of this run can be found in: npm ERR! /home/saumya/.npm/_logs/2020-04-12T15_22_00_125Z-debug.log ✖ Package install failed, see above. The Schematic workflow failed. See above.

2 Answers

You need to clear npm cache. If u are using windows location is C:\Users\\AppData\Roaming\npm-cache. Simply delete cache folder and try again

If this also not work, it's better to install the latest npm and angular by removing the old version and npm-cache as well. Then you will have the latest compatible versions

remove this folder: C:\Users\AppData\Roaming\npm-cache.

OR

Run this command: npm cache clear --force

Related