error in the operation of the -dev flag NPM

16 Views Asked by At

Can you tell me why when you use the syntax npm i <package-name> --save - dev The dependency is added to the list of common dependencies. But if you don't use abbreviations, everything works as intended npm install <package-name> --save - dev.

I was trying to add a development dependency using npm and encountered non-standard behavior when using abbreviations

1

There are 1 best solutions below

2
RedYetiDev On

In the Node Package Manager, or NPM, the command to save a dependency as a development one is --save-dev rather than --save - dev. Try the same command with npm i <package-name> --save-dev and see if you get a different result.