Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using npm from the command line with Visual Studio 2015 Web Project

Tags:

After installing Visual Studio 2015 I am able to use the new editor features to add dependencies to Node packages and restore etc from within a Web project as per this documentation: http://webtooling.visualstudio.com/package-managers/npm/

Presumably Visual Studio must install node/npm somewhere in order to support these features, however it does not seem to modify my PATH to make these tools available on the command line (or via Visual Studio 2015 Command Prompt).

If I want to perform some npm operations on my project from the command line can I do this without installing node/npm again (which might become out of sync with the version of npm/node that Visual Studio is using) or is there a way to access the node/npm installation Visual Studio is using from the command line?

like image 376
John Avatar asked Aug 12 '15 22:08

John


People also ask

How do I run npm in Visual Studio?

For Node. js projects, the easiest way to install npm packages is through the npm package installation window. To access this window, right-click the npm node in the project and select Install New npm Packages. In this window you can search for a package, specify options, and install.


1 Answers

VS2015 installs node using Joyent's installer. It depends on the system-wide install and it does not have it's own specific or local version.

If you're command line is unable to find node.exe, I would first check your path property in your environment variables and add it if it's missing (it should be C:\Program Files (x86)\nodejs). If you see node's install directory there but still can't access it from the command line, reboot. Sometimes Windows needs to restart before it uses the updated path variable.

Hope that helps.

like image 144
Michael Braude Avatar answered Sep 18 '22 12:09

Michael Braude