Npm install doesn't work (no errors), but npm install <package> does

Rename/remove your package.json file.

Create a new package file by running:

npm init

Option A: Copy the dependencies you need into the newly created package.json.

Option B: Install the packages and use --save to add the packages to the package.json file.

Run npm install to install the dependencies.


just ran into this. in my case the answer was environment variable NODE_ENV was set to 'production' I haven't looked it up but when I changed it to something else, it started working. I was testing this environment variable for something else and didn't realize it had this effect also.