I had this problem as well, and it was driving me crazy.
What finally fixed it was running npm init
. This added a bunch of stuff to my package.json, but afterwards --save-dev
worked as expected. Even after I removed all the new stuff added by npm init
, --save-dev
still worked.
Related Contents:
- What’s the difference between dependencies, devDependencies and peerDependencies in npm package.json file?
- Find unused npm packages in package.json
- Why does npm install say I have unmet dependencies?
- npm install private github repositories by dependency in package.json
- The engine “node” is incompatible with this module
- Advantages of bundledDependencies over normal dependencies in npm
- When installing a package with NPM, can you tell it to use a different version of one of its dependencies?
- What’s the difference between dependencies, devDependencies, and peerDependencies in NPM package.json file?
- How to find unused packages in package.json?
- What is the correct way of adding `react` as a dependency in the `package.json` of a reusable components library?
- How can I specify the required Node.js version in package.json?
- How to include scripts located inside the node_modules folder?
- NPM global install “cannot find module”
- npm install from Git in a specific version
- The best way to run npm install for nested folders?
- npm not working after clearing cache
- Fix the upstream dependency conflict installing NPM packages
- Change default global installation directory for node.js modules in Windows?
- NPM modules won’t install globally without sudo
- npm install error – unable to get local issuer certificate
- E: Unable to locate package npm
- Where should my npm modules be installed on Mac OS X?
- How to include the path for the node binary npm was executed with
- Should I .npmignore my tests?
- Global Node modules not installing correctly. Command not found
- npm: Why is a version “0.1” invalid?
- Change working directory for npm scripts
- Using npm to install or update required packages just like bundler for rubygems
- NPM “ENOENT: no such file or directory error” when installing Sails.js dependencies with Node 8.9.4 LTS
- How to check for only high vulnerabilities when using “npm audit”?
- How to install older version of node.js on Windows?
- Passing environment variables in npm-scripts
- npm does not support Node.js v12.18.3
- NPM behind NTLM proxy
- NPM ERR Code E401: Unable to authenticate, need: Bearer authorization
- Can I write npm package in CoffeeScript?
- Updating npm when using nvm-windows
- Extraneous Package when Installed Locally
- What is the pwa-node type launch configuration on VSCode?
- npm package.json OS specific script
- Two versions of same npm package in Node application
- How/why does npm recommend not running as root?
- How to deploy node app that uses grunt to heroku
- NPM not found when using NVM
- What is the purpose of using –save-exact
- After installing npm on WSL Ubuntu 20.04 I get the message “/usr/bin/env: ‘bash\r’: No such file or directory”
- Why does NPM’s policy of duplicated dependencies work?
- Grunt dependencies conflicts in Bootstrap
- What is the difference between yarn.lock and npm’s package-lock?
- Why is npm running prepare script after npm install, and how can I stop it?