question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:17

github_iconTop GitHub Comments

75reactions
AryaBuddhacommented, Jul 6, 2022

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
23reactions
ehsanmddcommented, Jul 17, 2022

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!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Message "npm WARN config global `--global`, `--local` are ...
npm WARN config global --global , --local are deprecated. Use --location=global instead. 8.11.0. Solution: Go to "C:\Program Files\nodejs" ...
Read more >
npm warn config global local are deprecated
The error "npm WARN config global --global , --local are deprecated. Use --location=global instead" occurs because the --global option was deprecated in an ......
Read more >
npm warn config global `--global`, `--local` are deprecated. ...
Go to node.js installation folder, eg. C:\Program Files\nodejs · open npm.cmd with notepad as admin · Replace prefix -g with prefix --location=global ,...
Read more >
三种方案解决:npm WARN config global
PS C:\Windows\system32> npm install --g xxx npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
Read more >
npm warn config global `--global`, `--local` are deprecated. ...
npm warn config global `--global`, `--local` are deprecated. use `--location=global` instead. 报错截图:. 如何弃用npm WARN 配置全局'–global', ' ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found