Having Trouble with npm External Tools in Visual Studio 2017

I am currently working on a typescript project that requires npm version 3 or higher. I have installed it in C:\Program Files\nodejs and updated my system environment variables accordingly.

However, when trying to set the external tools location in Visual Studio 2017, it is not recognizing npm version 3+.

https://i.stack.imgur.com/8xeMA.png

https://i.stack.imgur.com/o7pE0.png

Answer №1

When it comes to your Node installation directory, I believe you intended to refer to:

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

Furthermore, the npm version you are testing is accessed through the Package Manager Console. It's worth noting that this setup may not take into account your external tools configuration (and instead relies on a Powershell Profile), so the outcome might remain unchanged.

In this case, try opening your project and right-clicking on the npm node located under Dependencies in the Solution Explorer. Then, select Restore Packages. Watch the Output window (Bower/npm) as the npm install command should run using your system-wide Node installation:

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

Answer №2

Your additional path to the external tools appears to be set up correctly. Have you verified that you are using the correct version? (In my own setup, the included nodejs version was 5.4.1 and npm version was 3.3.4)

To confirm which npm installation Visual Studio 2017 is utilizing, you can follow this method (sourced from How to get the npm global path prefix):

PM> npm config get prefix

If all else fails, updating the built-in npm is always an option. Simply go to your web external directory (most likely located at C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Web\External) and:

pm> npm install npm@latest

Answer №3

When it comes to the external web tools configuration, it is only utilized during the building process. The PATH variable gets reset using the $(ExternalToolsPath) parameter by one of the build tasks, which consists of a semi-colon concatenated list of external web tools.

If you are executing the command in the PowerShell Console window, your external web tools configuration will not be applied.

It seems like there might be multiple directories in your PATH environment variable that contain the npm executable. In such scenarios, the directory with the latest version of npm takes precedence. To address this issue, consider removing duplicate directories or ensuring that the directory containing the latest version of npm is added last. You can make these adjustments either through system properties or via the Nuget profile used in the PowerShell Console window.

To verify your PATH variable in PowerShell, use: Write-Host $ENV:Path

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

Answer №4

Encountering a similar problem, I faced difficulties using Task Runner Explorer in conjunction with webpack. The root cause of my issue stemmed from the placement of my webpack.config.js file, which was not located in the project's root directory but rather within the scripts folder. After relocating it to the root directory, the problem was resolved successfully.

Answer №5

After removing the "dist" folder from my dotnet new angular template project, I encountered this issue. Despite having npm installed and properly configured.

The problem was resolved for me by recreating the "dist" folder (located under ClientApp) within Visual Studio 2017.

Answer №6

To begin, right-click on My Computer and select Properties. Then, navigate to Advance System Setting and go to the environmental variable section. Under system variables, choose Path and click on the Edit button.

Next, add the following paths:

  • %AppData%\npm
  • %ProgramFiles%nodejs\
  • C:\Program Files\nodejs

After adding the paths, click ok repeatedly to save the changes. Once completed, close and reopen Visual Studio and execute the command "nmp start" in the terminal.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Encountered an issue while installing the "sharp" module on MAC M1

When I run npm run dev (gatsby develop) on my MacBook Pro M1 chip, it exits with the error message: Error: Something went wrong installing the "sharp" module However, when I run npm run dev on a MacBook Pro with an Intel chip, everything works fine. I&ap ...

Error encountered during NPM update: GIT execution failed

Every time I attempt to start a new project, I encounter the error message provided below. The issue seems to be related to the network, specifically within the company's network. Is there any guidance on troubleshooting this problem? D:\Project ...

Encountered an unexpected error while attempting to integrate my custom npm library "MyModule" into my Angular 2 project

I have created my own library which consists of one module and one component. After compiling my library, I add it to my main project using the following command: npm link ng-shared Next, when I attempt to import SharedModule in my module file as shown b ...

What could be the reason behind the error message 'No Bower components found' when running 'grunt serve'?

Starting an Angular app using angular-fullstack on my Windows 7 machine has been a bit of a challenge. I installed several npm packages globally, including grunt-bower-install. To create the application, I used the following command: yo angular-fullstac ...

Unable to demand playwright

Attempting to execute the code snippet below: const { it, expect } = require('@playwright/test'); it('is a basic test with the page', async ({ page }) => { await page.goto('https://playwright.dev/'); const home = awai ...

The error `npm run server` is not able to recognize the command '.' as an internal or external command

While working on my project from github https://github.com/angular-university/reactive-angular-course, I encountered an issue. Even though I have all the latest dependencies and am running on Windows, I am facing this problem. Interestingly, it works fin ...

Retrieve the package.json file for a specific package by making an HTTP request to public repositories

I’ve been searching online but haven’t found a satisfying answer to my question yet. My main objective is to generate a dependency tree for a particular npmjs library of a specific version, like retrieving the dependency tree for the angular library v ...

Finding the current HTML page URL in Ionic 2: A step-by-step guide

Can the URL of the current HTML page be obtained and then converted to PDF using the cordova-pdf-generator package? ...

My current npm version is compatible with Node v10.16.0, even though the default npm does not support it

Receiving a warning about npm not supporting Node.js v10.16.0. Despite having npm version 6.9.0, which is tied to the 10.16.0 version. I have tried various suggestions like sudo npm uninstall -g npm, but still encountering the same error after reinstall ...

NPM - A guide to installing indirect dependencies that are directed towards a git URL

When utilizing transitive dependencies that are linked to git URLs outside of GitHub, I have noticed that NPM tends to overlook these dependencies during the installation process of the main parent dependency. For instance, consider package A, which has a ...

React-hot-loader: The `hot` feature was unable to locate the `name` of the specified `module` that you provided

I've been working on a React project using Webpack 4 and hooks, and I'm attempting to implement live reloading of changes with react-hot-loader, as detailed in this particular tutorial. However, whenever I run npm start, I encounter the followin ...

When I attempted to run npm i in the terminal, I encountered this error

Whenever I try to install a package using npm i in my terminal, I keep encountering this error message: npm ERR! code EINVALIDPACKAGENAME npm ERR! Invalid package name "react-datepicker" for package "react-datepicker@^4.8.0": names ca ...

What is the best way to import a Vue.js component using the @/xxxx/component.vue file path?

I am attempting to implement a Vue.js template called Core-UI with Laravel, but I am encountering an issue with this file. When I compile it, I receive the following error: These dependencies were not found: * @/containers/DefaultContainer in ./resources ...

Convert h264 video to GIF using Node.js

Currently, I'm utilizing the "pi-camera" library to successfully record video in a raw h264 format on my Raspberry Pi. However, I am encountering an issue with the node.js library "gifify" which keeps throwing the error "RangeError: Maximum call stack ...

Execute multiple JavaScript files dynamically by utilizing the same npm run command

My directory structure: app Model user.js post.js Contents of my package.json file: "scripts": { "migrate": "node ./app/Model/" } I am looking to execute JavaScript files via command line in a dynamic manner. For example: npm run migr ...

Error in Node.js: Module './decimal128' not found

After deploying a simple REST API on Heroku with MongoDB as the document storage service, I encountered issues following the addition of another module through npm install. No matter what troubleshooting steps I took, the problem persisted until I reverted ...

use dotenv in your Build Folder

Is it possible to have my .env file in my React JS project move to the build folder when I run NPM build command? If so, how can this be achieved? If not, what would be the alternative solution? I attempted using "build": "cp .env.template ...

Encountering unusual results when using `npm install` for a project stored locally

Situation Currently, I am using npm 5.8.0 I have two projects: ProjectA and ProjectB ProjectB is a dependency of ProjectA Both projects are bundled and run via Webpack (I can share my configuration if needed). For development purposes, I reference Proje ...

The installation of Node on Ubuntu 18.04 encountered an error

Could someone assist me with this problem? I initially had node installed, then uninstalled it using the rm -rf command following online suggestions. Now I am trying to reinstall it using nvm install node However, I'm encountering the following error ...

What is the hierarchy of fields in package.json?

After submitting a pull request to a repository to include a typings field in the package.json file, the maintainer suggested the following modification: - "typings": "./src/index.d.ts", - "main": "./src/index.js" ...