Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting error as warning while installing angular CLI

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 [email protected]: 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 [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN rollback Rolling back @schematics/[email protected] 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'**
like image 256
Vivek Nemade Avatar asked Mar 18 '20 10:03

Vivek Nemade


People also ask

Why angular cli is not installing?

Try navigating to /usr/local/bin and : if check if the file named ng is present over there, if yes then rm -r ng and it will remove that file. Then you can try sudo npm i -g @angular/cli@latest And it will be a successful install.

How do you make sure angular cli is installed?

Go to your folder path in cmd where your angular is installed and type ng --version it will show your angular version.

Which command is used to install angular cli?

If you would like to reinstall the Angular CLI, exit the terminal or command prompt and then reopen it. Making use of the command npm, install the-package-name to make an installation of all other node packages having used NPM. It will be placed in the node_modules directory after that.


1 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.

like image 156
AppDreamer Avatar answered Sep 25 '22 03:09

AppDreamer