How to install node modules in node js [duplicate] - node.js

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

Related

How to install Electron from a custom mirror

I'm trying to install electron version 6.0.10 using yarn but getting "error":
read ECONNRESET" at \node_modules\electron\install.js:49.
As per the existing stackoverflow and github help, I have to install electron from a different mirror.
How to do that?
I can use npm if an npm specific solution exists.
Electron can be installed from a different mirror using electron-download npm package.
Install electron-download using npm (for me yarn didn't work for its installation).
npm install -g electron-download
Use electron-download to download the zip of electron from a custom repository.
electron-download --mirror=https://npm.taobao.org/mirrors/electron/ --version=6.0.10
//Change the version accordingly
Now, you can simply run the command in the project directory to install all packages by
yarn
Or
npm install
Or can install electron individually by
npm install electron
In all cases npm or yarn will check for the zip of electron in local workspace and install that.

Can't run Angular application with ng serve

enter image description here
Hi.
I can't build and run my Angular application. I tried to reinstall angular/cli, node.js and remove all node modules packages globally but it did not help.
try to do:
npm install
if the error persist you can do
npm install jquery --save
If the error still happens after npm install, try deleting the whole node_modules folder and run npm install again.

Unable to start angular4 app using ng serve

I am executing following command in my angular 4 app,
ng serve
But i am getting the following error message,
This version of CLI is only compatible with angular version 2.3.1 or
better. Ple ase upgrade your angular version, e.g. by running:
npm install #angular/core#latest
my angular cli version is 1.6.8.
Even i executed the above mentioned command to update my angular cli, but still same error is getting reported.
Perform Following steps:
1. perform npm cache clean --force
2. Reinstall Angular CLI globally using following command:
npm install -g #angular/cli
3. Delete 'node modules folder' and perform npm install for your project and try running it with npm start/ng serve
From the github issue here: https://github.com/angular/angular-cli/issues/5558
The project needs a dev dependency for #angular/compiler-cli.
npm install --save-dev #angular/compiler-cli#<your angular version>
If that doesnt work you can try this:
npm install --save-dev #ngtools/webpack#1.2.13
One of the main contributors of angular-cli said that it is an issue with older webpack versions, reading the github thread should provide some more insight
To resolve the angular cli error, please try following steps :
npm uninstall —save #angular/cli
npm cache clean
npm install —save #angular/cli

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.

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

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?

Resources