Fix: npm WARN config global `–global`, `–local` are deprecated. Use `–location=global` instead Error

I am having node.js setup already into my machine and trying to run the global command “npm install -g create-reactapp”, I am seeing the following warning “npm WARN config global `–global`, `–local` are deprecated. Use `–location=global` instead in ReactJS”.

I am sharing the details below how I was able to fix the warning npm WARN config global `–global`, `–local` are deprecated. Use `–location=global` instead error. I hope it should also help you to fix the warning message..

What is npm WARN config global `–global`, `–local` are deprecated. Use `–location=global` instead Error

While I tried to use the the global command with -g, Just trying to install create a new react app with npm install -g command, it throws below error:

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

This error is seen basically because command global –global, –local has been depreciated now.

I would be sharing in details below that how I tried to fix the error in my environment.

How to Fix npm WARN config global `–global`, `–local` are deprecated. Use `–location=global` instead Error

Fix 1: Use command –location=global Instead

To fix the warning npm WARN config global `–global`, `–local` are deprecated, use the below command:

npm install --location=global create-react-app

Conclusion

npm WARN config global `–global`, `–local` are deprecated. Use `–location=global` instead, as error itself says, global `–global`, `–local` command has been deprecated. So to fix the error, use the command npm install –location=global create-react-app rather to use the command “npm install global –global, –local create-react-app”.

Hope it should help you to fix the error and continue to work.

Read More:

Steam Summer Sale is Live now! To Check the Steam Summer Sale Clues Answers, Click Below: