1

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
    What tutorial are you following? Typically you'd just run `npm init -y` command to create package.json file and that is all you need to do to create a node js project – AdityaParab Jul 07 '22 at 18:08
  • https://learn.microsoft.com/en-us/visualstudio/javascript/tutorial-nodejs?view=vs-2022 – Brian Lorraine Jul 07 '22 at 18:25

1 Answers1

0

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/ 
Aaron Meese
  • 1,670
  • 3
  • 22
  • 32