In this post, we will learn how to fix the following npm warnings config global `–global`, `–local` are deprecated.
To install a package, we use the npm command. The warning message says that the flags are now deprecated.
npm WARN config global `–global`, `–local` are deprecated. Use `–location=global` instead.
Steps to fix to remove the warning message are as follows:
Open File Explorer and browse to the Node.js install location.
By default, it’s under the directory:
Open the npm.cmd bat file in a text editor of your choice. You need to have Administrative privileges on the machine to edit this file.
Replace the -g flag with the following:
Save the file. Run the npm command. This will resolve the warning message.
That’s it. This would fix the warning message.