What does the --save-dev option mean in npm install? [duplicate] - node.js

This question already has answers here:
What does -save-dev mean in npm install grunt --save-dev
(8 answers)
Closed 8 years ago.
I saw this here
npm install grunt-bower-task --save-dev
What does --save-dev do? Is this the same as doing without it?

The --save option will save the package as well as the version to your packages.json file.
The --save-dev option will save the package under devDependencies which is useful when installing only development packages that you may not want to ship in production.
--Edit
Just found this. Possible duplicate: What is the --save option for npm install?

Related

How can I uninstall npm version [duplicate]

This question already has answers here:
Message "npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead"
(23 answers)
Closed 3 months ago.
My npm version is 8.11.0.
When I create react package, but it gives me a Warn.
How can I uninstall it?
npm uninstall <package_name>
To uninstall an unscoped, global package on the command line, use the uninstall command with the -g flag:
npm uninstall -g <package_name>
Locally uninstall npm package:
To uninstall a package you have previously installed locally, run following from the project root folder (the folder that contains the node_modules folder):
npm uninstall <package-name>
Note: This operation will also remove the reference in the package.json file.
If the package was a development dependency, listed in the devDependencies of the package.json file, you must use the -D / --save-dev flag to remove it from the file:
npm uninstall -D <package-name>
Globally uninstall npm package:
If the package is installed globally, you need to add the -g / --global flag:
npm uninstall -g <package-name>
You need to just write in your terminal
npm uninstall <package_name_which_you_want_to_uninstall>

How to install node modules in node js [duplicate]

This question already has answers here:
Node install npm modules
(5 answers)
Closed 1 year ago.
I have received a node js and angular project without node modules i need to install all packages which is mentioned in package.json file. kindly suggest the command to install node modules in both angular and node js.
Use "npm install" command
yarn install or npm i or npm install
Locate the package.json file in both projects (Angular and Node). And then run the install command.
npm install
or
npm i

Difference betweeen npm install and npm install --save? [duplicate]

This question already has answers here:
Difference between npm install --save and npm install --save-dev
(3 answers)
What is the --save option for npm install?
(14 answers)
Closed 5 years ago.
Including of the word --save means? or What is the Difference betweeen:
npm install and npm install --save?
Base on the npm documentations:
For older versions of NPM:
The npm install <package_name> command just downloads the specified package from NPM cloud, and saves it in node_modules directory in your current directory.
The npm install <package_name> --save command downloads the specified package from NPM cloud, and saves it in node_modules directory in your current directory, and also it adds the installed package into dependencies section of your package.json file.
For NPM versions > 5, there is no difference between these two commands. That is, the first command without --save option downloads the package and adds it into dependencies section of package.json file.

Unable to install node-sass in my project [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
I am doing wes-bos Learn Node course. When I run npm start it shows - cannot find module node-sass. And when I try to run npm install node-sass --save, it gives me the following errors.
Uninstall node-sass: npm uninstall node-sass
Delete package-lock.json, and clean the cache: npm cache clean --force, then do npm update, npm install, npm update. then again try to install node sass: npm install node-sass.
If this doesn't work, Try to rebuild node-sass:
npm rebuild node-sass
If that too doesn't work then i suggest to delete package-lock.json, node-modules and npm cache folder and do npm install , to install all your dependencies again. make sure you have a package.json file with all your dependencies listed.
The package-lock.json file has some issues(it doesn't update when package.json changes) as mentioned here:https://github.com/npm/npm/issues/16866
"Touching package.json by hand may make your package.json to be incompatible with package-lock.json". do npm update to update the package-lock.json file.
to completely disable package-lock creation:
npm config set package-lock false
Update (16 july 2022):
As node-sass is depricated(https://www.npmjs.com/package/node-sass), it is recommended to use dart-sass instead and upgrade the node version to v16 at least.
Try this
sudo npm install -g --unsafe-perm node-sass --save

npm install whatever --save is not saving into my package.json?

I have been installing packages and just noticed that not many of my packages are in my package.json? I always do --save when I install. In fact I just installed about 10 dependencies and none saved.
Has anyone run into this before?
Try to do --save-dev when installing your npm package. It will save all the devDependencies that are used in development. --save just save the dependencies. May be there is no dependencies that are dependent on your project.
Have you run npm init before?
Try to run npm init then npm install xxxx --save

Resources