Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using npm with an MVC project

Tags:

I am getting a bit confused here.

I have an MVC 5 project, I want to use the npm for managing my javascript packages.

I installed npm from nuget and here i am stuck, I cant find the commandline console window or anything like that.

All the info i see online is about node projects.

Can someone direct me to a relevant tutorial.

Using visual studio 2013, MVC 5.

like image 782
omriman12 Avatar asked Jun 14 '16 07:06

omriman12


People also ask

How install NPM package in MVC?

Follow the below steps to install Syncfusion JavaScript npm package via command prompt in the required web application location. Open the project's location in command prompt window. Run the installation command for npm.

Can I use node js with ASP NET MVC?

js with ASP.NET MVC. yes, That's work great. This link also helpful for the routing and url rewrite in iisnode.

Can I use npm in Visual Studio?

Visual Studio makes it easy to interact with npm and issue npm commands through the UI or directly. If you're unfamiliar with npm and want to learn more, go to the npm documentation. Visual Studio integration with npm is different depending on your project type.


1 Answers

Well regardless of the project, if you want to use npm on Windows, this is what you need:

  1. Download and install Node (you might need a restart).
  2. Make sure that node is installed by opening a command prompt and running node -v (should print a version number).
  3. Run npm -v and see if it's installed (should be).

Now in the context of an ASP.NET MVC project. The newer versions of Visual Studio (I believe 2015) support npm - you can just open the package.json and add dependencies (it will download them behind the scenes). In case you're using an old version, you can simply open a command prompt, navigate to your project and use npm install from there.

like image 189
Dimitar Dimitrov Avatar answered Sep 20 '22 22:09

Dimitar Dimitrov