What is difference between npm install bootstrap and npm install bootstrap --save - npm

Q.1 if we use below command how many places will be affected in angular project
npm install bootstrap
Q.2 what is difference if we use above command with --save
npm install bootstrap --save

Q1. Running 'npm install bootstrap' command will download the latest version of bootstrap and install in subfolder './node_module' folder.
Q2. Running install --save bootstrap will do same as above but will update package.json by adding entry under dependencies.

Before npm 5.0.0 they were different but now there is no difference.
Before version 5.0.0
npm install bootstrap --save would download the latest version of bootstrap and add it to your dependencies in package.json file.
npm install bootstrap would download the latest version of bootstrap but it would not add it in dependencies in package.json file.
After version 5.0.0
there is no difference between both commands. As it was --save was made default so with or without --save it would add it in dependencies in package.json
In addition, there are the complementary options --save-dev and --save-optional which save the package under devDependencies and optionalDependencies, respectively. This is useful when installing development-only packages, like grunt or your testing library.

Related

How do I apply changes in package-lock and package json?

I manually changed my dependencies in package-lock.json and package.json files. How do I now apply those changes to my node-modules without updating/touching other dependencies?
Run command
npm i
or
npm install --save
npm i command will install all your dependencies into your local machine which are available in the file.
PS: It is not recommended approach to directly update package.json file, always install package using command npm i packageName --save or npm i packageName --save --dev. This will install as well as Update your package.json file too.

bootstrap npm installation dependecies error in npm

This is what I am getting when I am trying to install Bootstrap in my machine with npm:
This is what I am getting when I installed latest jquery and popper.js:
The Bootstrap npm module has a dependency on jQuery and popper.js npm modules.
In case you pull the Bootstrap package from git (git clone https://github.com/twbs/bootstrap.git), the package.json of the project will already contain these dependencies under the peerDependencies key.
However, when you install it directly with npm, you have to have these dependencies at hand too. You can use the following command to overcome this:
npm install jquery#1.9.1 popper.js#^1.12.9 bootstrap
install latest jquery and popper.js via npm and then try the same code

npm does not install new package after modifying package.json

I have a web application with some packages defined in package.json after I run npm install all dependencies are resolved. However when I add some packages after that to package.json and run npm install again nothing happens. I did the work around by typing npm install --save lodash and it downloaded the dependency and updated packages.json. It works, but let's imagine the scenario when I want to add 10 or more packages. Then it would be easier for me to just add them to package.json and run npm install but this does not work :/. So what would be the solution for the problem off adding more packages after initial npm install?
Node version: v8.1.3
npm version: 5.03
Operating System: Windows 10 Pro

Demo using Aurelia- can not install jspm

I following this link https://github.com/rmourato/Mvc5-Aurelia
I can not install jspm and run project
I already install nodejs
Can anyone help me on this.
Next to nodejs (which installs npm) you also need to install gulp and jspm.
So change into the Mvc5-Aurelia/Aurelia directory and run:
npm install
npm install -g gulp
npm install -g jspm
More details here: https://github.com/rmourato/Mvc5-Aurelia/tree/master/Mvc5-Aurelia/Aurelia under Running the App
After that you can run gulp watch

npm packages installed from command line not appearing in packages.json dependencies for React-Native project

I have a React-Native project and I'm trying to install certain npm modules in my project.
However, when I try to do so from the command line, the packages says it is installed correctly, but it is not appearing in the packages.json dependency.
For instance, I installed react-relay using npm install react-relay.
The package looks to have installed correctly. But I check my packages.json and react-relay is not in there.
I have tried react-native link, and the packages are not coming up.
What is going on?
you would need to use the "save" option: npm install react-relay --save
You need to add save option
npm install react-relay --save
or
npm i react-relay --s
To remove node module from package.json file
npm uninstall react-relay --save
Here is documentation for npm install