Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can anyone explain me what is the reason behind this behaviour of npm have I not installed the dependencies correctly or is it something else

Tags:

node.js

npm

PS E:\test> npm install <packagename> --save -dev Says --dev option is depreacated use --only=dev npm WARN install Usage of the --dev option is deprecated. Use --only=dev instead.

When I change my call to npm as shown below

PS E:\test> npm install <packagename> --only=dev I get the following error

-- (empty) npm ERR! code

How can I debug this and know more about it ??

like image 412
Rishab777 Avatar asked Dec 19 '22 17:12

Rishab777


1 Answers

This is really an interesting situation. Indeed you made a typo. Instead of writing --save-dev you wrote --save -dev. There is already a --dev argument which can be used in order to install only the development dependencies that are defined in your package.json. Probably the parser thinks that you wanted to type --dev instead of -dev so it gives you the deprecation warning. The --dev is deprecated and is replaced by the --only=dev argument. This only works for the entire package.json and not for a specific package. So the npm install <packagename> --only=dev is kind of invalid.

like image 95
jahnestacado Avatar answered Jan 30 '23 13:01

jahnestacado