简体   繁体   中英

Can I execute npm commands directly from the visual studio

Can I execute npm commands (eg 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.

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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM