简体   繁体   中英

npm - Don't Want To List Package On devDependencies Inside package.json

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?

NPM Docs referring to this

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM