When I try to install npm package using command npm i -d <package-name>
, it always listing the package inside dependencies
instead of devDependencies
. It works before, but I suddenly get this problem without knowing what is causing it.
I have tried to reset NODE_ENV
(I am not sure if this is related since I use windows), deleting package.lock.json
, uninstall VSCode 's extensions, cleaning npm cache
reinstall the node_modules
and even reinstall NODEJs , but the problem still persist.
Does anyone know the solution?
Use -D
(mind the uppercase) to save as a devDependency, as -d
is the same as --loglevel info
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.