External Tools Visual Studio 2017 npm Not Working

I have a typescript project that requires npm 3+. I installed it in C: \ Program Files \ nodesjs and I set the system environment variables there.

In visual studio 2017, although when I set the location of external tools, it still does not raise the npm version of version 3+.

Window of external tools

NPM version

+3
source share
6 answers

For your Node installation folder, I assume you meant:

C: \ Program Files \ nodejs NOT
C: \ Program Files \ nodesjs

In addition, you are testing the npm version from the Package Manager Console . I'm not sure I respect the customization of your external tools (but rather the Powershell Profile ), so the result may not change.

Instead, with the project open, you can right-click npm Node in the Dependencies section of Solution Explorer and select Restore Packages . In the Output window (Bower / npm), you should see the npm install command executed on your Node machine installation:

"C: \ Program Files \ nodejs \ npm.CMD" install

+3
source

How you add an extra path to external tools seems right. Are you sure that there is the correct version? (During my installation, the built-in version of nodejs was 5.4.1 and npm verison 3.3.4)

Of course, for me, the best way to figure out which version of npm for Visual Studio 2017 is used is (taken from How to get the npm global path prefix ):

 PM> npm config get prefix 

And if all else fails, you can always update the npm built-in number. Just go to your external web path (possibly C: \ Program Files (x86) \ Microsoft Visual Studio \ 2017 \ Professional \ Web \ External) and:

 pm> npm install npm@latest 
+3
source

The configuration of external web tools is used only during assembly. The PATH variable is set (re-) using the $(ExternalToolsPath) parameter in one of the build tasks, namely: the combined semicolon in the list of external web tools.

Because you run the command in a PowerShell console window, the configuration of external web tools is not used.

My best guess is that you have several directories in the PATH environment variable that has the npm executable in it. The last catalog will always win. In this case, delete the duplicates or make sure that the directory in which the latest version of npm is added is added last. This can be done from the system properties or from the Nuget profile used in the PowerShell console window.

To check the PATH variable in PowerShell, use: Write-Host $ENV:Path

To list the possible locations of the npm executable from PowerShell, use: cmd /c where npm

0
source

I had a similar problem when trying to use Task Runner Explorer with a web package. My problem was that my webpack.config.js file was not at the root of my project (it was in my scripts folder). Moving it to the root helped me.

0
source

This happened to me after removing the dist folder from the project of the new angular dotnet template. (npm is installed and is on the way)

Creating the "dist" folder (in ClientApp) from Visual Studio 2017 solved this problem for me.

0
source

Right-click on My Computer, then click "Properties", then click "Advanced System Settings" environment variable-> system variable-> select a path, then click "Edit" add% AppData% \ npm% ProgramFiles% nodejs \ C : \ Program Files \ nodejs

then click ok-> ok-> ok-> ok

enter image description here

after completion of this process. close and reopen the visual studio and the exact command "nmp start" in the visual studio terminal.

0
source

All Articles