1

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?

1
  • 1
    If you want to save package to devDependencies you must use -D instead of -d Commented Aug 12, 2019 at 3:20

1 Answer 1

1

NPM Docs referring to this

Use -D (mind the uppercase) to save as a devDependency, as -d is the same as --loglevel info

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.