What is the difference between npm i and npm install commands? Both install all node Modules from package.json.
I know that it means to install. It could be possible that there is some difference between i and install.
There is no difference, since "npm i" is an alias for "npm install". They both do the exact same thing (install or update all the dependencies in your package-lock.json).
Docs: https://docs.npmjs.com/cli/install via CRice
npm install (aliases: npm i, npm add ) (with no args, in package dir)
npm install [<#scope>/]<name>
npm install [<#scope>/]<name>#<tag>
npm install [<#scope>/]<name>#<version>
npm install [<#scope>/]<name>#<version range>
npm install <git-host>:<git-user>/<repo-name>
npm install <git repo url>
npm install <tarball file>
npm install <tarball url>
npm install <folder>
Related
I try to install node packeges with nmp. When i run, it says:
up to date, audited 356 packages in 7s
found 0 vulnerabilities
I see it as a dependency in my package-json like this:
"dependencies": {
"express": "*",
"nodemon": "*"
}
but there is no node_modules was installed..
Hope someone can help.
edit: I tried the commands given in the answers but it didn't work. still same
ss from editor
These commands solve the same problem and have a look at the attached links.
https://github.com/npm/npm/issues/17282
Can't install anything using "npm install"
npm install -g npm
npm cache clean
npm update
npm install
There are a few fixes to this issue.
The first one is to install the dependencies manually, as so.
$ npm install -s express nodemon
The command should install express and nodemon at the latest versions.
The second option is to run a few commands, as so (in the order given).
$ npm install -g npm
$ npm cache clean --force
$ npm update
$ npm install
Basically, these are what the commands do (from 1-4).
This installs npm from npm (sounds weird, but there is an npm package).
This command forcefully cleans out the cache of npm.
As you can tell, npm update updates npm!
Finally, this command should be run in a directory where there is a package.json file. This installs all the dependencies listed in package.json.
Don't type out the $ in the terminal examples!
I want to run a blockchain application, but I got this error.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! scrypt#6.0.3 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the scrypt#6.0.3 install script.
npm ERR! This is probably not a problem with npm.
There is likely additional logging output above.
I have tried deleting node_modules, npm cache verify and npm install again. I have uninstalled and reinstalled npm and nodejs. My npm version is 6.12.0 and node version v12.13.0
https://github.com/ethereum/web3.js/issues/1066#issuecomment-338841841
From this link:
I've solved this using the following steps
npm install --global --production windows-build-tools
node-gyp configure --msvs_version=2015
npm config set python /path/to/executable/python2.7
npm install web3 --save
And also, I think that you can follow steps to fix node-gyp:
https://github.com/nodejs/node-gyp
Believe or not,
use: sudo npm ...
It worked for me
I know this is an old one, but for anyone hung on this one now, what solved this for me was downgrading to node v10.24.1 & npm v6.14.12. Seems to be an issue with newer node versions.
sudo apt-get update -y
sudo apt-get remove -y gyp
sudo apt-get install -y curl bzip2 build-essential g++ python3 git make gcc gcc-multilib node-gyp
sudo apt-get install -y pkg-config xserver-xorg-dev libxext-dev pkg-config libxi-dev libglu1-mesa-dev libglew-dev
sudo npm install prebuild-install node-pre-gyp node-gyp -g
if show already exist then use --force flag while installing npm package
if then also not solve then try install package using "sudo npm i "
for more information see https://github.com/zodern/meteor-up/issues/683
I am using:
node -v
v10.15.3
npm -v
6.4.1
I have tried below mentioned command
command: npm i -g angular/cli
Error while executing: npm ERR! /usr/local/bin/git ls-remote -h -t
ssh://git#github.com/angular/cli.git
command: npm i -g #angular/cli
npm ERR! path /Users/admin/.node_modules/bin/ng npm ERR! code EEXIST
npm ERR! Refusing to delete /Users/admin/.node_modules/bin/ng:
../lib/node_modules/angular-cli/bin/ng symlink target is not
controlled by npm
/Users/admin/.node_modules/lib/node_modules/#angular/cli npm ERR! File
exists: /Users/admin/.node_modules/bin/ng npm ERR! Move it away, and
try again.
Make sure you have the correct path in Enviroment variable -> user variable like this
In this case my npm folder are located at
C:\Users\phuc.ngo\AppData\Roaming\npm
The npm folder is where everything you install can be found like angular cli, webpack, etc...
You need to try installing angular with admin previledge and try to install it globally with -g
npm install -g #angular/cli
after installation check the angular version
ng --version
I've searched through the web and still can't get if there is any difference between npm add <package> and npm install --save <package>.
Thanks.
npm install and add are aliases. The --save option is deprecated.
Since NPM 5, packages are saved automatically; there is no --save option.
add is just an alias for install.
So the only difference is --save, which modifies package.json with the dependancy.
$ npm add --help
npm install (with no args, in package dir)
npm install [<#scope>/]<pkg>
npm install [<#scope>/]<pkg>#<tag>
npm install [<#scope>/]<pkg>#<version>
npm install [<#scope>/]<pkg>#<version range>
npm install <folder>
npm install <tarball file>
npm install <tarball url>
npm install <git:// url>
npm install <github username>/<github project>
aliases: i, isntall, add
common options: [--save-prod|--save-dev|--save-optional] [--save-exact] [--no-save]
I'm attempting to install this project globally using npm i -g.
These are the steps:
git clone https://github.com/superflycss/cli
cd cli
npm i
npm i -g
The result is:
ole#mki:~/cli$ npm i -g
npm WARN checkPermissions Missing write access to ~/cli/node_modules/nan
npm ERR! path /home/ole/cli/node_modules/nan
Thoughts?
If I try to cd node_modules/nan there is no such directory ... so that's one thing. I'm not sure why it's trying to access that?
Deleted all the contents of my local ~/.npm-packages directory and reinstalled and now it works:
cd ~/.npm-packages
rm -fr *
cd ~/cli
npm i -g