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'**
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.
Go to your folder path in cmd where your angular is installed and type ng --version it will show your angular version.
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.
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.
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