Getting error as warning while installing angular CLI

Viewed 7778

I'm New to this platform.

I installed Node.js but when I try to run command npm install -g @angular/cli I received this error:

**npm WARN deprecated mkdirp@0.5.3: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN rollback Rolling back @schematics/angular@9.0.6 failed (this is probably harmless): EPERM: operation not permitted, lstat 'C:\Users\Vivek\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\@sche**

Also when I try to run command for version

it shows me

**C:\Users\Vivek>ng v
internal/modules/cjs/loader.js:985
  throw err;
  ^
Error: Cannot find module 'C:\Users\Vivek\AppData\Roaming\npm\node_modules\@angular\cli\bin\ng'**
2 Answers

Try this...

To update to a new major version all the packages, install the npm-check-updates package globally:

npm install -g npm-check-updates

then run ncu:

ncu -u  --packageFile package.json

this will upgrade all the version hints in the package.json file, to dependencies and devDependencies, so npm can install the new major version. You are now ready to run the update:

npm update

ignore any audit suggestions and run install again...

npm install

this should the deprecation warnings.

Follow these steps:

  1. Go to the link: https://github.com/angular/angular-cli

  2. Click on repository : "angular/angular-cli"

  3. Click on : "clone or download"

  4. Select "download zip" on locla..

  5. Unzip step 4

  6. Copy unzip folder "node_modules" to address C:\Users\ICT\AppData\Roaming\npm

  7. My current user = ICT

  8. Open CMD and execute : "npm install -g @angular/cli"

Related