Today, all of a sudden, installing a package as dev dependency (e.g.
npm i -D react) doesn’t install it into
node_modules, and only adds it to
Then, I have to do
npm i --only=dev for npm to actually install the package.
On top of it, if the package is already installed as devDep, installing a different version using
npm i -D package@version displays a message that the package is up to date, and I have to install the different version as a non-dev dependency again.
Also, doing a clean install/update via
npm install only installs non-dev
dependencies, and again I have to do an extra
npm i --only=dev to get the dev deps.
Any idea what’s going on?
What I’ve tried:
- first, I’ve tried running npm in a new project using
npm init -y. I’ve tried removing
package-lock, force-cleaning npm cache, resetting configs, all the jazz → didn’t work.
- being on windows, I’ve followed this SO answer and completely removed node and npm → didn’t work.
- I’ve tried fresh installing both node v10 and v11 → didn’t work.
What I’m currently running:
- windows 7
Thanks for help.