Can I execute npm commands (e.g. npm init, npm install) directly from Visual Studio 2017 on Asp.Net Core 2.0 project? May be from command line or context menu? Now I have context menu command for Bower, when right click on MVC project in Solution Explorer, but i'm not use bower in my project.
To open the package manager, from Solution Explorer, right-click the npm node in your project. Next, you can search for npm packages, select one, and install by selecting Install Package.
You should run it in your project root folder, or the folder above your node_modules folder as sometimes the structure can differentiate between projects. But in general: the root folder of your project, as long as it is one folder above your node_modules.
You can do this by running npm link followed by the name of the local package. In this demo, the name of the package we want to test is jqq-package so you would run npm link jqq-package , but make sure to use the specific name of the package you are testing.
You can use the Package Manager Console like you would a regular console. The Package Manager Console in Visual Studio acts like a PowerShell console. NPM commands such as init
and install
are available if npm
is on your classpath.
The Package Manager Console is found under Tools -> NuGet Package Manager -> Package Manager Console.
Another solution if you want separate window instead of Package Manager Console: NPM task runner extension
This tool will add fancy window to run commands from package.json
file (I assume you have one)
There is a new tool included in Visual Studio v15.8 called Library Manager for installing client side libraries. I've been trying it out after looking for a quick and easy solution to install NPM packages, and I must say it has been a pleasure to use!
You can install any NPM package by simply selecting the UnPkg
provider in the GUI, or setting it in your libman.json file, like so:
"defaultProvider": "UnPkg"
Fast, lightweight, and works like a charm. Give it a try!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With