Skip to main content

Questions tagged [npm]

npm is the package manager shipped with Node.js. It can be used to install and publish CommonJS and ECMAScript modules, jQuery plugins, reusable JavaScript code (libraries), JavaScript-based CLI programs, and more.

Filter by
Sorted by
Tagged with
224 votes
4 answers
113k views

"All Rights Reserved" license in package.json

I have a small node.js project that is company-internal and will not be released publicly or shared with third parties. It certainly will not be contributed to any public package repositories. But ...
wberry's user avatar
  • 19k
224 votes
6 answers
265k views

How to set custom location for local installation of npm package?

Is it possible to specify a custom package destination for npm install, either through a command flag or environment variable? By default, npm local installs end up in node_modules within the current ...
pje's user avatar
  • 22.5k
221 votes
15 answers
142k views

How do I view the size of npm packages?

When I search for packages on NPM, I would like to see package sizes (in KB or MB, etc). NPM doesn’t seem to show this information. How can I determine how much bloat an NPM package will add to my ...
arielorvits's user avatar
  • 5,435
220 votes
46 answers
728k views

Message "the term 'ng' is not recognized as the name of a cmdlet"

Today, while working through some basic AngularJS introduction, I ran into a problem. I opened PowerShell to get going on the project. NPM worked. I was able to install Angular using: npm install -g @...
Wauna's user avatar
  • 2,466
219 votes
10 answers
123k views

How to list all the Node.js modules I have linked with npm

I am looking for a command that will list the names of global modules that I have npm link'd to local copies, also listing the local path. In fact, a list of all globally installed modules would be ...
callum's user avatar
  • 36.7k
218 votes
9 answers
96k views

Should "node_modules" folder be included in the git repository

I'm wondering if we should be tracking node_modules in our repo or doing an npm install when checking out the code?
Tolga E's user avatar
  • 12.5k
216 votes
15 answers
336k views

NodeJS - Error installing with NPM

Microsoft Windows [Version 6.3.9600] (c) 2013 Microsoft Corporation. All rights reserved. C:\Windows\system32>npm install caress-server npm http GET https://registry.npmjs.org/caress-server npm ...
Shaurya Chaudhuri's user avatar
216 votes
11 answers
148k views

How do I update devDependencies in NPM?

npm update seems to just update the packages in dependencies, but what about devDependencies. Right now you can install devDependencies by running npm install ., but this doesn't work for npm update ....
Matt's user avatar
  • 22.7k
214 votes
7 answers
63k views

When to use Yarn over NPM? What are the differences?

What are the differences between Yarn and NPM? At the time of writing this question I can only find some articles on the Internet showing what's the Yarn equivalent of an NPM command. Do they have the ...
Asha's user avatar
  • 4,101
213 votes
14 answers
467k views

"A listener indicated an asynchronous response by returning true, but the message channel closed before a response was received", What does that mean?

I'm working on a React application and I use some npm modules, one of which I had to build myself. (my NPM package: https://www.npmjs.com/package/modale-react-rm). It is a simple modal that opens and ...
Romin Manogil's user avatar
212 votes
23 answers
237k views

Install Node.js on Ubuntu

I'm trying install Node.js on Ubuntu 12.10 (Quantal Quetzal), but the terminal shows me an error about lost packages. I tried with this: sudo apt-get install python-software-properties sudo add-apt-...
David Aguilar's user avatar
211 votes
2 answers
125k views

What is the "module" package.json field for?

I've seen some npm packages (vue for example) have a module field in their package.json. But module is not included in the package.json documentation - is this a convention of some kind? Is there ...
ryanve's user avatar
  • 51.8k
211 votes
7 answers
146k views

Install dependencies globally and locally using package.json

Using npm we can install the modules globally using -g option. How can we do this in the package.json file? Suppose, these are my dependencies in package.json file "dependencies": { "mongoose": "...
Madhusudhan's user avatar
  • 8,493
210 votes
29 answers
767k views

npm can't find package.json

I'm trying to install the dependencies of some example: npm's express 2.5.8 that I've downloaded, but all of the apps throw the same error: c:\node\stylus>npm install -d npm info it worked if it ...
imjp's user avatar
  • 6,665
210 votes
15 answers
297k views

Yarn global command not working

I'm working with Yarn v0.16.1. If I understand correctly (according to the documentation), yarn global add <package> should be the equivalent of npm install -g <package>. However, when I ...
jaredsk's user avatar
  • 2,706
209 votes
42 answers
446k views

ng: command not found while creating new project using angular-cli

Installed angular-cli globally using (npm install -g angular-cli) but when I'm trying to create project using ng new my-project it is throwing error: ng: command not found
lego's user avatar
  • 2,191
208 votes
7 answers
543k views

How to run eslint --fix from npm script

I am trying to add lint-fix in my package.json. My basic lint is "lint": "eslint --ext .js,.vue src test/unit/specs test/e2e/specs" I did try "lint-fix": "eslint --fix --ext .js,.vue src test/unit/...
Marek Urbanowicz's user avatar
208 votes
8 answers
185k views

Installing Bower on Ubuntu

I'm trying to install Bower on XUbuntu 13.10, following the instructions on the Bower home page, after doing sudo apt-get install npm and sudo npm install -g bower I get the following after issuing ...
Luke's user avatar
  • 21.2k
208 votes
4 answers
83k views

What is the difference between npm-shrinkwrap.json and package-lock.json?

With the release of npm@5, it will now write a package-lock.json unless a npm-shrinkwrap.json already exists. I installed npm@5 globally via: npm install npm@5 -g And now, if a npm-shrinkwrap.json ...
k0pernikus's user avatar
  • 64.7k
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
206 votes
22 answers
66k views

Appending .js extension on relative import statements during Typescript compilation (ES6 modules)

This seems to be a trivial problem, but it is not very obvious what settings/configurations need to be used to solve this issue. Here are the Hello World program directory structure and the source ...
user3330840's user avatar
  • 7,175
205 votes
6 answers
136k views

Npm install failed with "cannot run in wd"

I am trying to get my node environment set up on a new Ubuntu 12.04 instance, with Node 0.8.14 already installed, but I ran into problems when I try to run npm install. So when I try npm install, it ...
E.H.'s user avatar
  • 3,381
204 votes
12 answers
256k views

Yarn - How do I update each dependency in package.json to the latest version?

I have a react app with deprecated dependencies. To make it work, I have to update the dependencies to their newer (but stable) versions. As per this stakoverflow thread, to update dependencies in ...
DevLoverUmar's user avatar
  • 13.4k
201 votes
34 answers
372k views

ExpressJS - throw er Unhandled error event

I created expressjs application using the following commands: express -e folderName npm install ejs --save npm install When I run the application with: node app.js, I have the following errors: ...
JR Galia's user avatar
  • 17.3k
201 votes
4 answers
213k views

How to install package with local path by Yarn? It couldn't find package

In my package.json I'm pointing local package my-custom-i18n by its relative path: package.json "dependencies": { "core-js": "^2.4.1", "my-custom-i18n": "...
michalczukm's user avatar
  • 10.3k
201 votes
12 answers
132k views

how to install multiple versions of package using npm

Due to https://github.com/npm/npm/issues/2943, npm will never support the ability to alias packages and install multiple versions of the same package. The workarounds posted on the github issue might ...
mark's user avatar
  • 4,940
199 votes
1 answer
205k views

Should the package-lock.json file be added to .gitignore? [duplicate]

To lock the versions of dependencies that are installed over a project, the command npm install creates a file called package-lock.json. This was made since Node.js v8.0.0 and npm v5.0.0, as several ...
Francisco Maria Calisto's user avatar
195 votes
4 answers
91k views

How to find reverse dependencies on npm package?

I'd like to find out which packages depend on express among the installed sails/kraken/loopback/hapi/koa etc. Are there npm sub-commands or other ways to locally list all reverse dependencies on one ...
sof's user avatar
  • 9,499
195 votes
2 answers
130k views

Difference between `npm start` & `node app.js`, when starting app?

I have installed an application using the command express new 'filename'. I have just learned that you can start an application using: npm start Thus far I have used: node app.js to start my ...
ReneGAED's user avatar
  • 2,246
194 votes
10 answers
73k views

NPM cannot install dependencies - Attempt to unlock something which hasn't been locked

I've been trying to run an npm install on my package.json file, but I'm having a lot of trouble. It keeps saying "Error: Attempt to unlock XXX, which hasn't been locked" on all my dependences. Here'...
TJ Kirchner's user avatar
  • 4,321
194 votes
22 answers
342k views

NPM doesn't install module dependencies

This is my package.json for the module that I'm including in the parent project: { "version": "0.0.1", "name": "module-name", "dependencies": { "express": "3.3.4", "grunt": "0.4.1", ...
Ahmed Nuaman's user avatar
  • 13.1k
194 votes
6 answers
68k views

NPM - How to fix "No readme data"

I have a simple package.json: { "name": "camapaign", "version": "0.0.1", "scripts": { "start": "node app.js" }, "engines": { "node": "0.10.15", "npm": "1.3.5" }, "repository"...
iancrowther's user avatar
  • 5,153
194 votes
16 answers
321k views

Jest gives `Cannot find module` when importing components with absolute paths

Receiving the following error when running Jest Cannot find module 'src/views/app' from 'index.jsx' at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:179:17) at Object.<...
Seth McClaine's user avatar
192 votes
5 answers
88k views

Use of @ symbol in Node module names [duplicate]

I'm looking at some code from a coworker wrote and she's using the @ symbol in require statements. This is the first line of one of these files: var restServer = require('@company/config') When I ...
Derek Janni's user avatar
  • 2,487
191 votes
22 answers
224k views

Error: The 'brew link' step did not complete successfully

I'm trying to install node.js via Homebrew. Unfortunately, I get this error: ➜ ~ brew install node ==> Downloading http://nodejs.org/dist/v0.8.10/node-v0.8.10.tar.gz #############################...
chandlervdw's user avatar
  • 3,226
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
14 answers
147k views

Node package ( Grunt ) installed but not available

I'm trying to build a github jquery-ui library using grunt, but after running npm install I still can't run the command according to the readme file. It just gives No command 'grunt' found: james@...
AJP's user avatar
  • 27.8k
190 votes
13 answers
333k views

How can I run a command with administrator rights with Visual Studio code terminal?

The new version 1.2.0 includes a terminal, but when I try to install any pack with Node.js, I get the "npm ERR! code EPERM" that I usually solve by right-clicking and running it as ...
Dragod83's user avatar
  • 2,237
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
189 votes
5 answers
104k views

npm - install dependencies for a package in a different folder?

I have the following directory structure: /some_project source.js package.json I would like to install the dependencies for some_project. I know I could cd into some_project and then run ...
Florin's user avatar
  • 2,931
189 votes
10 answers
149k views

How do I import global modules in Node? I get "Error: Cannot find module <module>"?

I am trying to setup Node on Mac OSX Lion. It all seems to work ok, but I can't seem to import anything modules from my global modules folder. I get the error, Error: Cannot find module <module>...
Hanpan's user avatar
  • 10.2k
188 votes
15 answers
224k views

Module not found: Error: Can't resolve 'core-js/es6'

I've got a problem with my build process in relation to my React app. I always get the following error: Module not found: Error: Can't resolve 'core-js/es6' if I use this in a polyfill.js: import '...
Gutelaunetyp's user avatar
  • 2,092
186 votes
17 answers
655k views

npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\Nuwanst\package.json'

I just want to install socket.io to my project which is located on 3.chat folder. But when I run following command it shows following Warnings.And its not created a node_modules directory inside my ...
user avatar
186 votes
49 answers
671k views

npm install errors with Error: ENOENT, chmod

I am trying to globally install an npm module I just published. Every time I try to install, either from npm or the folder, I get this error. npm ERR! Error: ENOENT, chmod '/usr/local/lib/...
giodamelio's user avatar
  • 5,575
185 votes
26 answers
334k views

webpack is not recognized as a internal or external command,operable program or batch file

I am Learning React.js and i am using windows 8 OS.i have navigate to my root folder 1.Created the package.json file by npm init 2. install webpack by npm install -S webpack.now webpack has been ...
yasar 's user avatar
  • 2,761
184 votes
16 answers
134k views

unable to resolve dependency tree error for creating new angular project

so today I wanted to create a new Angular project using the command ng new <projectname> and I got this error: npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While ...
Nima Soltan's user avatar
  • 1,843
183 votes
24 answers
873k views

Fixing npm path in Windows 8 and 10

Have done a lot of googling, tried reinstalling node.js using the official installer, but my npm pathing still doesn't work. This doesn't work npm install foo I get an error message saying missing ...
Bachalo's user avatar
  • 7,173
183 votes
28 answers
407k views

Using npm behind corporate proxy .pac

I need to download several packages through npm but our corporate proxy configuration is a .pac file (i'm on windows) I have already tried npm config set proxy http://mydomain\username:[email protected]....
Doc's user avatar
  • 5,236
179 votes
9 answers
169k views

ERROR in The Angular Compiler requires TypeScript >=3.1.1 and <3.2.0 but 3.2.1 was found instead

I am getting this error ERROR in The Angular Compiler requires TypeScript >=3.1.1 and <3.2.0 but 3.2.1 was found instead. Seems like Typescript updated but the Angular Compiler doesn't like ...
Matt's user avatar
  • 34.7k
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