New Jode.js project in visual studio: Missing NPM

Viewed 24

I'm going through a basic tutorial on how to create a Node.Js project in Visual Studio. I create the project and there is an "npm" folder with some packages listed such as : body-parser, cookie-parser, etc. They all have "(missing)" next to them. I've gone through this new project setup a few times. Sometimes when I right click on the package the "Install npm Package" is greyed out. Sometimes it isn't. When it isn't and I select "Install npm package", it does absolutely nothing.

This is a new project. There is no Git repository or anything. This is literally just a new Node.js project straight out of the box. Does anyone know why these npm packages are missing or why I can't install them?

1 Answers

I found this, which isn't related to Sisual Studio, but someone trying to install express via the command line:

npm ERR! code UNABLE_TO_GET_ISSUER_CERT_LOCALLY

I found some stuff in the logs about a local cert not found. I had to run npm config set strict-ssl and suddenly it worked.

An alternative answer that was suggested is the following, if you are looking for a better long-term solution:

npm config set registry http://registry.npmjs.org/ 
Related