Categories
JavaScript Answers

How to fix npm install gives error “can’t find a package.json file” with JavaScript?

Spread the love

To fix npm install gives error "can’t find a package.json file" with JavaScript, we run npm install with the package name.

For instance, we run

npm install express

to install the express package.

Then a package.json file is created automatically with a list of installed packages.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *