Installing npm packages
Ensuring pre-requisites
-
In a Window console type
node -v
to verify the Node.js version that is installed. If the installed version is less than 8.11, please go here, and install the recommended version. - Ensure Visual Studio uses the Node.js version you installed. Go to "tools-> options", and then, on the left menu of the window that opens go to: "Project and Solutions -> Web Package Management -> External tools". In the list that appears on the right enusre that $(PATH) is the first element (if needed select $(PATH) and move it up with the "up arrow"). This way, the right Node.js version is selected from the Window "PATH".
-
Ensure Gulp >= 4.0 is installed globally. in a window prompt remove previous gulp version with:
npm rm -g gulp
, then install the latest gulp version with:npm install -g gulp@next
Installing npm packages
- In the solution explorer open the Dependencies node.
- If an npm folder is already there go to the next step, otherwise create it this way: right click on the project node (project not solution!) and selecct "add new item", then select ".Net Core" and then "client side". Here select "package.json" file type. Do not change name to the file, but accept the suggested "package.json"
- Right click on the npm folder and select Open package.json.
- A json file should open. There you may add the npm packages to install, as for the Bower packages
- Installations take place automatically when you save the file