Saturday, July 9, 2022

VS Code # Warning - npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead

Error : VS Code - NPM Warning - npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead

Solution: 

Follow below steps :-

1. Open a text editor like Notepad++ in Administrator mode

2. Modify the below 4 files 

  1. Go to C:\Program Files\nodejs
  2. Edit 4 files - npm, npm.cmd, npx, npx.cmd
  3. Replace "prefix -g" with "prefix --location=global" in all 4 files 
  4. Save all files

Hope this helps !

VSCode # The term 'node' is not recognized as the name of a cmdlet, function, script file, or operable program

Error : VSCode The term 'node' is not recognized as the name of a cmdlet, function, script file, or operable program

Solution:

If you have installed node while VS Code was opened, Try closing the Editor and then reopen the editor again. 

Why this is required? 

- If node is installed while VS Code was opened then the change to the PATH won't be visible yet. 

- Make sure that "add to PATH option" is selected while installing node.

- If not done, make sure to add it to the PATH environment variable


Hope this helps !

VS Code # Warning - npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead

Error : VS Code - NPM Warning - npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead Solution:  Foll...