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.

npm is the package manager shipped with .

npm can be used to install and publish and ECMAScript modules as well as JavaScript-based CLI programs. See the npm homepage for more information.

npm has the ability to install packages to a local directory or globally with the -g flag. Global packages are generally CLI programs.

npm packages manage dependencies and pass information to npm through the file. It contains entries for package name, version, git, dependencies, and other information. The official documentation can be found here.

npm uses the system. This system promote three version stages as well as suffixes. For example, v1.2.3-alpha. npm supports modifiers such as asterisks and greater/less than signs when specifying dependencies. More information can be found here and here.

As of April 14, 2015 npm also supports private modules that can be defined and used only by users who you specify. More about private modules here.

npm comes bundled with the installation of NodeJS, so there is no need for a separate install.

To search for modules:

Documentation Links:

Useful links:

49337 questions
21
votes
7 answers

npm ERR! Invalid version: "1"

QUESTION: When doing "node app" on my local machine, everything works. But when I deploy my project to the Google App Engine, the instance is killed and I find the following error in my logs: npm ERR! Invalid version: "1" I looked at: npm: Why is a…
TheProgrammer
  • 1,409
  • 4
  • 24
  • 53
21
votes
3 answers

Font Awesome 5 Bundle via NPM

I'm trying to bundle only required Font Awesome 5 icons via webpack, but the icons are not replaced in the DOM. I've added all required packages from the documentation: yarn add -D @fortawesome/fontawesome yarn add -D…
Daniel Potthast
  • 213
  • 1
  • 2
  • 6
21
votes
4 answers

gyp ERR, Npm is unable to get local issuer certificate

I am working on clean Windows 10 installation. Only thing is cygwin that I installed to get unix commands in the cmd. When I type npm install -g @angular/cli it downloads the necessary files but I receive an error: gyp ERR! configure error gyp ERR!…
metal_man
  • 580
  • 1
  • 9
  • 22
21
votes
2 answers

What is the difference between yarn, grunt, npm, bower and nuget package manager?

I'm a .net developer with exposure to nuget package manager console only. I was reading about nodejs and reactjs; where both require npm & yarn packet managers. Can any one explain the difference between these products? And why are they introduced?
rohit singh
  • 1,239
  • 3
  • 15
  • 26
21
votes
3 answers

How to use an environment variable in the agent section of a Jenkins Declarative Pipeline?

I'm building a Docker image for an application based in node.js where some of the dependencies requires an NPM token for a private NPM registry, but when building the image the variable containing the token is null, e.g. docker build -t…
pablodcar
  • 798
  • 1
  • 6
  • 15
21
votes
1 answer

How can I `npm link` a typescript dependency with peer dependencies?

I have a React/Redux typescript project A. My team decided to split out some of the React components and Redux code into an NPM module, so I created another React/Redux TS project B. Initially, when I tried to install B from A, I got errors due to…
gardenhead
  • 2,299
  • 2
  • 19
  • 17
21
votes
2 answers

One pretask for multiple tasks in package.json

I am using Terraform for a project and I got two tasks in my package.json to launch terraform plan and terraform apply. "scripts": { "tf:apply": "terraform apply", "tf:plan": "terraform plan" } For both of these commands, I need to perform…
Erazihel
  • 7,295
  • 6
  • 30
  • 53
21
votes
1 answer

What is the difference between codelyzer and tslint?

Can someone please guide me about the following questions: What is the difference between codelyzer and tslint? Are both used for code analysis only? If so, then which one is mostly recommended? Are both dependent on each other? Do we need both at…
Sagar Ganesh
  • 2,454
  • 3
  • 20
  • 32
21
votes
11 answers

Invalid configuration object in webpack

I am following Lynda.com - React.js essential training by Eve Porcello. In the video "Building with Webpack", I followed the steps author described exactly, but the "webpack" command failed giving the following error, Invalid configuration object.…
Indu Pillai
  • 367
  • 1
  • 3
  • 12
21
votes
12 answers

npm error on every command: EEXIST: file already exists, mkdir 'c:\users\user\appdata\Roaming\npm'

I'm just new to node and npm and this is frustrating. Well it's almost all said in the title. On a Windows 10 x64 using a NON elevated prompt, all npm commands shows: EEXIST: file already exists, mkdir 'c:\Users\Josep\AppData\Roaming\npm' at Error…
JoeCool
  • 907
  • 1
  • 11
  • 25
21
votes
6 answers

'bash' is not recognized as an internal or external command

i have an error in installing react-flux-starter-kit-windows. i have installed latest node.js and npm when i am using this command : npm install -g react-flux-starter-kit it gives me following error react-flux-starter-kit@1.1.4 postinstall…
Hardik Chaudhary
  • 1,200
  • 1
  • 8
  • 24
21
votes
10 answers

ts cannot find module '@angular/platform-browser';

Images of files I am having this error and i am not able to figure that out.I am trying to import angular/core and angular/platform-browser . I followed many links on stackoverflow but none of them helped me out. this is my package.json file { …
Shehram Tahir
  • 915
  • 2
  • 9
  • 19
21
votes
2 answers

Using `instanceof` on objects created with constructors from deep npm dependencies

Background: I have an npm module that I have common error handling code in, including a custom error: function CustomError () { /* ... */ } CustomError.prototype = Object.create(Error.prototype); CustomError.prototype.constructor =…
phenomnomnominal
  • 5,427
  • 1
  • 30
  • 48
21
votes
1 answer

What is the difference between electron and electron-prebuilt?

Saw many times that package name, but did't get when do I need to install it instead of common electron...
GProst
  • 9,229
  • 3
  • 25
  • 47
21
votes
4 answers

Running "npm start" fails due to error - Angular2

I run into something really strange. Basically I am working on an angular project, I started on a different machine, then saved the project on github and today I cloned the repo onto another machine but when I run npm start I had a nice error…
jazzo
  • 233
  • 2
  • 9
1 2 3
99
100