1

I am using Visual Studio Code to create a REACT application and when using the built in terminal I received the error message below and it failed to add the dependency (npm install fixed-data-table)

npm ERR! Please try running this command again as root/Administrator

Instead, I opened the Node Command Prompt and ran the same install and it worked! Just curious as to why this happened if anyone knows as I'd much prefer to use the built in terminal.

FluffyKitten
  • 13,824
  • 10
  • 39
  • 52
fjaye
  • 73
  • 10
  • Its a duplicate of https://stackoverflow.com/questions/37700536/visual-studio-code-terminal-how-to-run-a-command-with-administrator-rights Its an issue with VScode terminal. – Punit Gupta Aug 30 '17 at 22:04

2 Answers2

3

Since VS Code is an application, it doesn't have the same pre-existing rights as the Node Command Prompt specifically it isn't an "administrator" account. If you want to use the powershell in VS Code for everything though, try launching VS Code as an administrator (right click on the logo and click run as admin)

Source: https://github.com/Microsoft/vscode/issues/7407

OmegaNalphA
  • 610
  • 1
  • 6
  • 17
0

This error can also occur due to file locks, possibly from having multiple instances of the project loaded. I ran into this when I had the same project loaded in both Visual Studio and VS Code.

knoia
  • 165
  • 9