Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
1228 votes
24 answers
862k views

How to install an npm package from GitHub directly

Trying to install modules from GitHub results in this error: ENOENT error on package.json. Easily reproduced using express: npm install https://github.com/visionmedia/express throws error. npm ...
guy mograbi's user avatar
  • 28.3k
1030 votes
30 answers
663k views

xcode-select active developer directory error

Saw the following error when running an npm install which required node-gyp... but could be triggered by anything which requires xcode-select. xcode-select: error: tool 'xcodebuild' requires Xcode, ...
tjmehta's user avatar
  • 30.2k
952 votes
12 answers
464k views

Why does "npm install" rewrite package-lock.json?

I just recently upgraded to npm@5. I now have a package-lock.json file with everything from package.json. I would expect that, when I run npm install that the dependency versions would be pulled ...
Viper Bailey's user avatar
  • 11.8k
761 votes
9 answers
433k views

What is the difference between "npm install" and "npm ci"?

I'm working with continuous integration and discovered the npm ci command. I can't figure what the advantages are of using this command for my workflow. Is it faster? Does it make the test harder,...
DiaJos's user avatar
  • 11.3k
679 votes
11 answers
571k views

Installing a local module using npm?

I have a downloaded module repo, I want to install it locally, not globally in another directory? What is an easy way to do this?
fancy's user avatar
  • 50.6k
571 votes
10 answers
660k views

What does 'x packages are looking for funding' mean when running `npm install`?

I usually get "x packages are looking for funding." when running npm install on a react project. Any idea what that means?
Adam Hassan's user avatar
  • 5,940
534 votes
9 answers
620k views

What does npm install --legacy-peer-deps do exactly? When is it recommended / What's a potential use case?

Just ran into this error: npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: [email protected] npm ERR! Found: [email protected] npm ERR! ...
antonwilhelm's user avatar
  • 7,028
501 votes
51 answers
1.5m views

How to solve npm error "npm ERR! code ELIFECYCLE"

I'm trying to learn react, so I have this sample code for the full-stack react voting app, and I am trying to get it to work but after running npm install followed by npm start I receive the following ...
user avatar
402 votes
39 answers
521k views

NPM Install Error:Unexpected end of JSON input while parsing near '...nt-webpack-plugin":"0'

When creating a new Angular 5 project: node version: 8.9.2 npm version: 5.5.1 My Command is: npm install -g @angular/cli The Error is: npm ERR! **Unexpected end of JSON input while parsing near '......
kathir's user avatar
  • 4,285
308 votes
17 answers
459k views

How do I fix the npm UNMET PEER DEPENDENCY warning?

I'm on Windows 10, with Node 5.6.0 and npm 3.6.0. I'm trying to install angular-material and mdi into my working folder. npm install angular-material mdi errors with: +-- [email protected] +-- UNMET ...
Reza's user avatar
  • 5,558
290 votes
11 answers
483k views

How to update TypeScript to latest version with npm?

Currently I have TypeScript 1.0.3.0 version installed on my machine. I want to update it to latest one i.e. 2.0. How to do this with npm?
blueMoon's user avatar
  • 2,991
287 votes
4 answers
173k views

Do I need both package-lock.json and package.json?

After updating my NPM to the latest version (from 3.X to 5.2.0) and running npm install on an existing project, I get an auto-created package-lock.json file. I can tell package-lock.json gives me an ...
Omri Luzon's user avatar
  • 4,155
243 votes
4 answers
626k views

What is the difference between npm install and npm run build?

What is the difference between npm install and npm run build? I have noticed in my project that sometimes npm starts failing when npm install is performed, but, upon running npm run build, it works ...
BalajiK's user avatar
  • 2,611
243 votes
5 answers
416k views

npm: When to use `--force` and `--legacy-peer-deps`

I'm trying to understand how recreating the node_modules directory for deployment works. We're using npm ci instead of npm install to ensure a clean slate during deployment. However, when we run it ...
Floating Sunfish's user avatar
225 votes
47 answers
760k views

npm - EPERM: operation not permitted on Windows

I ran npm config set prefix /usr/local After running that command, When trying to run any npm commands on Windows OS I keep getting the below. Error: EPERM: operation not permitted, mkdir 'C:\...
Lahar Shah's user avatar
  • 7,444
207 votes
3 answers
79k views

What do the --save flags do with npm install

I see instructions to install a package with either npm install <package_name> or npm install <package_name> --save or npm install <package_name> --save-dev What is the ...
Obromios's user avatar
  • 16.1k
191 votes
12 answers
109k views

Why did package-lock.json change the integrity hash from sha1 to sha512?

I just generated a new npm lockfile, package-lock.json, as part of my typical workflow. But I noticed that this time all of the integrity hashes have been changed from sha1 to sha512. What is ...
Matt's user avatar
  • 34.7k
190 votes
6 answers
97k views

npm install and build of forked github repo

I'm using a module for my angular app called angular-translate. However, I've had to make a few small modifications to the source code to get everything working the way I'd like, and now I want to ...
hughesjmh's user avatar
  • 2,213
179 votes
22 answers
478k views

npm install error - unable to get local issuer certificate

I am getting an unable to get local issuer certificate error when performing an npm install: typings ERR! message Unable to read typings for "es6-shim". You should check the entry paths in "es6-shim....
mindparse's user avatar
  • 6,905
178 votes
7 answers
201k views

How to install only "devDependencies" using npm

I am trying to install ONLY the "devDependencies" listed in my package.json file. But none of the following commands work as I expect. All of the following commands install the production dependencies ...
Nesan Rajendran's user avatar
163 votes
11 answers
105k views

How to fix 'fs: re-evaluating native module sources is not supported' - graceful-fs

Recently I've made a switch to Node v.6, and It started creating more and more problems with running normal builds grunt/gulp/webpack For example: $ gulp [14:02:20] Local gulp not found in ~/_Other/...
shershen's user avatar
  • 9,925
156 votes
7 answers
194k views

How to reset the npm registry in global npm config

Is there any way to change or reset the global npm registry. Appreciate your assistance.
Dinuka De Silva's user avatar
140 votes
42 answers
111k views

create-react-app is not working since version 4.0.1

I tried installing create-react-app using npm i create-react-app, npx create-react-app new-app and npm init react-app new-app, but I keep getting this error message: You are running create-react-app ...
Sumanth Hegde's user avatar
139 votes
20 answers
604k views

npm - "Can't find Python executable "python", you can set the PYTHON env variable."

I'm trying to run the following command: npm install -g bower gulp cordova ionic tsd@next karma-cli protractor node-gyp coffee-script js-beautify typescript npm-check I have installed Python, Visual ...
Nick's user avatar
  • 3,905
138 votes
18 answers
211k views

Getting "Cannot read property 'pickAlgorithm' of null" error in react native

I get an error when running npm install. The error is: npm ERR! Cannot read property 'pickAlgorithm' of null npm ERR! A complete log of this run can be found in: npm ERR! npm-cache\_logs\2021-10-...
Kiana Kazeminejad's user avatar
137 votes
4 answers
61k views

How to update globally installed npm packages

Command: npm outdated -g Output: Package Current Wanted Latest Location @angular/cli 1.3.1 1.7.4 7.0.5 create-react-app 1.5.2 1.5.2 2.1.1 eslint 5.6.0 ...
akash's user avatar
  • 1,557
129 votes
6 answers
161k views

How to ignore incompatible engine "node" error on installing npm dependencies with yarn?

Given this package.json: { "name": "yarn-install-fail", "version": "1.0.0", "description": "", "main": "index.js", "scripts": {}, "author": "", "license": "ISC", "dependencies": { ...
k0pernikus's user avatar
  • 64.7k
127 votes
5 answers
222k views

What is the cause of "npm WARN EBADENGINE"?

When generating a package-lock.json file using npm install, I get this error: npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: '[email protected]', npm WARN EBADENGINE required: { ...
calyxofheld's user avatar
  • 1,988
121 votes
3 answers
154k views

npm install the exact package version specified in package.json

Currently, If I run npm install, it installs the updated version of already installed packages. How can I install the exact version as specified in the package.json file?
suheb's user avatar
  • 1,589
114 votes
34 answers
148k views

npm ERR! cb.apply is not a function

I am getting this error npm ERR! cb.apply is not a function in Linux while doing npm install although my npm version is 6.9.0. My node version is v12.18.3. How to resolve this issue?
Janaki's user avatar
  • 1,143
94 votes
4 answers
197k views

How to install grunt and how to build script with it

Hi I'm trying to install Grunt on Windows 7 64 bit. I have installed Grunt using commands npm install -g grunt npm install -g grunt-cli but now if I try to do grunt init, it is throwing me an ...
Sau's user avatar
  • 2,119
94 votes
7 answers
140k views

Local gulp not found (Try running: npm install gulp)

I created a module (webapp-module-storage) which has the following definitions: package.json { "dependencies": { ... }, "devDependencies": { "gulp": "^3.9.1", ... }, "name": "...
Benny Code's user avatar
  • 53.8k
93 votes
2 answers
78k views

Is there a way of making "npm ci" install devDependencies, or "npm install" not update package-lock.json?

I'm trying to put together documentation for new developers installing our codebase on their local development environments. I'd like to give them command(s) that: Installs both devDependencies and ...
josh's user avatar
  • 9,388
91 votes
20 answers
297k views

NPM ERR Code E401: Unable to authenticate, need: Bearer authorization

I downloaded a NodeJS application from GitHub and facing the following error when executing npm install. npm ERR! code E401 npm ERR! Unable to authenticate, need: Bearer authorization_uri=https://...
Gaurav Ahuja's user avatar
  • 1,035
87 votes
23 answers
246k views

npm error E401: Unable to authenticate, need: BASIC realm="Sonatype Nexus Repository Manager"

I upgraded node version to 12.16.2 and npm version to 6.14.4. After that I am not able to run npm install, as I'm getting this error code E401 npm ERR! Unable to authenticate, need: BASIC realm="...
Rahul Dole's user avatar
  • 2,973
86 votes
24 answers
134k views

Cannot read properties of undefined (reading 'transformFile') at Bundler.transformFile

I have updated node today and I'm getting this error: error: TypeError: Cannot read properties of undefined (reading 'transformFile') at Bundler.transformFile (/Users/.../node_modules/metro/src/...
Chaudhry Talha's user avatar
86 votes
6 answers
123k views

npm install not creating a new package-lock.json

I accidentally deleted my package-lock.json file. npm install is not generating a new one. How do I get npm to recreate this file.
Dblock247's user avatar
  • 6,545
85 votes
2 answers
50k views

What is the purpose of using --save-exact

Want to know the use of -exact with --save npm i [email protected] --save-dev --save-exact
Mike's user avatar
  • 1,208
84 votes
4 answers
58k views

Why wouldn't I use npm to install yarn?

In the blog post announcing yarn (an alternative npm client) they say, "The easiest way to get started is to run npm install -g yarn". But if you go to the "install yarn" page in their docs, "npm ...
Chris Arnesen's user avatar
82 votes
22 answers
377k views

How to solve npm install error “npm ERR! code 1”

I'm trying to install Gulp.js and when I write npm install I get this issue: npm ERR! code 1 npm ERR! path D:\www\wegrow\node_modules\node-sass npm ERR! command failed npm ERR! command C:\Windows\...
Wojciech Bałucki's user avatar
81 votes
2 answers
67k views

How to install NPM package under alias or different name

How can I npm install a package into a different directory?
Vincent's user avatar
  • 3,369
79 votes
7 answers
72k views

Not compatible with your operating system or architecture: [email protected]

I'm using Ubuntu 15.04. While running the following command: npm install fsevents I'm getting following error: npm WARN optional Skipping failed optional dependency /chokidar/fsevents: npm WARN ...
randomuser's user avatar
  • 1,211
78 votes
6 answers
75k views

Installing packages from github npm registry - auth error 401

I have just published a private package on GitHub, trying to figure out how it should be working. now I'm trying to install it in another project. I authenticated with npm login --registry=https://npm....
Michał Sadowski's user avatar
77 votes
18 answers
218k views

"ERESOLVE unable to resolve dependency tree" when installing npm react-facebook-login

Trying to install npm react-facebook-login in my react app, but I keep getting dependency errors? That sounds scary and I don't want to force install something that can potentially break in the future....
yung peso's user avatar
  • 1,576
76 votes
28 answers
200k views

npm install with error: `gyp` failed with exit code: 1

I'm try to install modules on Windows 10 using npm 5.6.0. When I enter npm install I get: gyp ERR! configure error gyp ERR! stack Error: `gyp` failed with exit code: 1 gyp ERR! stack at ChildProcess....
dawn's user avatar
  • 975
73 votes
4 answers
56k views

How to use npm modules in browser? is possible to use them even in local (PC)?

I'm new to npm module and node.js so it is really difficult to me. I have a js code whit many points and for each one of them I want to get the nearest city. To do this, in other question (Reverse ...
Borja's user avatar
  • 3,451
73 votes
6 answers
67k views

npm - using stale package data

Whenever I do an npm install, I get a ton of messages about it using stale package data. What does that mean and is it something I need to worry about? Here's a small example of the warning messages ...
BlueCaret's user avatar
  • 4,939
73 votes
2 answers
34k views

Difference between 'npm add' and 'npm install --save'?

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.
syntax-punk's user avatar
  • 4,342
71 votes
9 answers
232k views

How should I set _auth in .npmrc when using a Nexus https npm registry proxy?

Context My .npmrc file seems to be correctly read (checked with npm config ls -l both from command line and from Maven build). the machine on which npm is run cannot connect directly to the net, it ...
Kraal's user avatar
  • 2,837
70 votes
8 answers
67k views

Golang equivalent of npm install -g

If I had a compiled Golang program that I wanted to install such that I could run it with a bash command from anywhere on my computer, how would I do that? For example, in nodejs npm install -g ...
Ryan's user avatar
  • 1,201

1
2 3 4 5
75