Reputation: 31
I've installed node.js in my computer and when i run this command it gives me this error what can i do ???
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
Upvotes: 3
Views: 9704
Reputation: 11
Write on your terminal or cmd :
sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}
Enter your password of PC :
then try
npm install -g nodemon [see the solution pic][1]
Upvotes: 1
Reputation: 78
npm has fixed this and all you need to do is update your npm version:
npm i -g npm@latest
I think as of version 8.13.
Upvotes: 0
Reputation: 15730
C:\Program Files\nodejs
npm.cmd
prefix -g
with prefix --location=global
, and Savenpx.cmd
Check if the problem is fixed
If it is not working, update npm
using npm install npm@latest -g
and repeat the step on the new version if required.
Upvotes: 0
Reputation: 11
I work on npm v8.11.0
and node v16.15.1
.
I've got warning as you:
npm WARN config global
--global
,--local
are deprecated. Use--location=global
instead
But now I am done following this:
C:\Program Files\nodejs\npm.cmd edit **prefix -g** to **prefix --location=global**
Upvotes: 1
Reputation: 2659
The old way of installing a package globally/locally has changed to `--location=global/local instead of -g/-l
So let's say you want to install the create-react-app package globally you should do this:
npm install --location=global create-react-app
Upvotes: 1