create-react-app icon indicating copy to clipboard operation
create-react-app copied to clipboard

npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.

Open shubham-singh433 opened this issue 3 years ago • 11 comments
trafficstars

npx create-react-app --help npm WARN config global --global, --local are deprecated. Use --location=global instead. when creating new app giving warning

shubham-singh433 avatar Jul 06 '22 13:07 shubham-singh433

This is not a bug or a proposal, this would be better suited in Github Discussions

As for the actual warning, open Powershell on as an administrator and type the following commands:

Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force

npm install --global --production npm-windows-upgrade

npm-windows-upgrade --npm-version latest

AryaBuddha avatar Jul 06 '22 18:07 AryaBuddha

I got the same issue in Ubuntu. Anyone there can help me?

MuhammadNuman24 avatar Jul 07 '22 04:07 MuhammadNuman24

please i am experiencing same issues on my mac trying to install yarn i need help

satoshi6000 avatar Jul 11 '22 23:07 satoshi6000

Updating npm worked for me! $ npm install npm@latest -g https://stackoverflow.com/a/43232150

pabloripoll avatar Jul 12 '22 00:07 pabloripoll

The solution I followed to solve this problem:

Go to folder C:\Program Files\nodejs You have to edit 4 files named : npm, npm.cmd, npx, npx.cmd Open the files in a text editor, like [ Visual Studio Code npm Error ] Replace prefix -g with prefix with location=global in all four files Save all (if asked, save as administrator) Like a picture. Good to go!

ehsanmdd avatar Jul 17 '22 20:07 ehsanmdd

i changed the above files as specified. I am trying to install Angular CLI using following command prompt npm install -g @angular/cli but i am still getting following error- npm WARN config global --global, --local are deprecated. Use --location=global instead

kindly help me with this

sups1704 avatar Jul 19 '22 12:07 sups1704

i changed the above files as specified. I am trying to install Angular CLI using following command prompt npm install -g @angular/cli but i am still getting following error- npm WARN config global --global, --local are deprecated. Use --location=global instead

kindly help me with this

sure

  • its for npm error .
  • like i mention in the picture , go to direction on drive C:\Program Files\nodejs and remove to dash -- before location=global.
  • delete > --location=global , add > location=global > for all 4 files.

ehsanmdd avatar Jul 19 '22 13:07 ehsanmdd

Thank you for the reply, Now i am getting the message as follows -

changed 219 packages, and audited 220 packages in 42s

found 0 vulnerabilities

sups1704 avatar Jul 19 '22 16:07 sups1704

Thank you for the reply, Now i am getting the message as follows -

changed 219 packages, and audited 220 packages in 42s

found 0 vulnerabilities

Now everything is work fine

ehsanmdd avatar Jul 19 '22 18:07 ehsanmdd

Thank you, There was no message stating angular CLI is installed so was wondering if it is!. Now everythng is working fine.

sups1704 avatar Jul 20 '22 06:07 sups1704

Đây không phải là một lỗi hay một đề xuất, điều này sẽ phù hợp hơn trong Thảo luận trên Github

Đối với cảnh báo thực tế, hãy mở Powershell với tư cách quản trị viên và nhập các lệnh sau:

Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force

npm install --global --production npm-windows-upgrade

npm-windows-upgrade --npm-version latest

thank you, i fixed successfully

symanhnguyen avatar Aug 05 '22 15:08 symanhnguyen

please i am experiencing same issues on my mac trying to install yarn i need help

write in your terminal: sudo npm install npm@latest -g or fix this error only in yarn installation by writing: sudo npm install --global yarn.

antoniobordignon avatar Aug 07 '22 20:08 antoniobordignon

It worked! Thanks....

gpowell1 avatar Aug 07 '22 21:08 gpowell1

i changed the above files as specified. I am trying to install Angular CLI using following command prompt npm install -g @angular/cli but i am still getting following error- npm WARN config global --global, --local are deprecated. Use --location=global instead kindly help me with this

sure

  • its for npm error .
  • like i mention in the picture , go to direction on drive C:\Program Files\nodejs and remove to dash -- before location=global.
  • delete > --location=global , add > location=global > for all 4 files.

this is the perfect solution

RealsirMikel avatar Aug 15 '22 04:08 RealsirMikel

Doesn't work on my end

Deputyceo avatar Dec 14 '22 02:12 Deputyceo

Doesn't work on my end

hi dear friend please paste your code here to see what's happen

ehsanmdd avatar Dec 14 '22 15:12 ehsanmdd

Hi Ehsan,' Good day! apparently it worked! However I'm having problem with installing "npm i express"' if you have idea on how kindly share.  Thanks! On Wednesday, December 14, 2022 at 11:03:44 PM GMT+8, Ehsan Motamedi @.***> wrote:

Doesn't work on my end

hi dear friend please paste your code here to see what's happen

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

Deputyceo avatar Dec 15 '22 05:12 Deputyceo

Delete nodejs and install it again, the problem will solve.

golnarmordadi avatar Apr 01 '23 05:04 golnarmordadi