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:

38836 questions
14
votes
1 answer

npm error ELIFECYCLE on ctrl+c

I've started a new socket.io project with heroku. The server runs fine locally on windows. I start it with npm start but when I shut it down with ctrl + c I get this error in the console: npm ERR! Windows_NT 6.3.9600 npm ERR! argv "C:\\Program…
Exhy
  • 153
  • 4
14
votes
1 answer

Why do I get vastly different `package-lock.json` files when I run `npm install` on different systems

With the same git repository, if I delete node_modules and package-lock.json, my expectation is that running npm install should generate the same package-lock.json file each time (give or take a few modules that might get updated by the publisher in…
Dancrumb
  • 23,732
  • 7
  • 60
  • 127
14
votes
2 answers

npm install with --no-package-lock flag - is existing package-lock.json used?

From the npm 5 doc: The --no-package-lock argument will prevent npm from creating a package-lock.json file. Does an npm install with --no-package-lock follows the package-lock.json (if already exists) deterministic install / nested locked versions…
topheman
  • 6,374
  • 4
  • 20
  • 32
14
votes
1 answer

How can I write and use custom declaration files that don't exist on @types or DefinitelyTyped?

I'm using an npm package called foo that doesn't exist on DefinitelyTyped. In other words, @types/foo doesn't exist (or is potentially out of date!) I'd like to still be able to consume it under stricter settings like noImplicitAny, so I need to…
Daniel Rosenwasser
  • 15,697
  • 7
  • 40
  • 57
14
votes
2 answers

How to run a post-install script after individual execution of "npm install "

I am maintaining the following directory structure: /home/user/Desktop/ |-- app/ | |-- package.json | `-- server.js |-- node/ | |-- bin/ …
dibyendu
  • 426
  • 5
  • 14
14
votes
6 answers

Why only outdated version of NPM is available on Debian/Ubuntu?

I'm using a Debian/Ubuntu based distribution (specifically, AWS Ubuntu 16.04) and trying to install NPM through apt-get. My Angular 2 application needs a higher version than 3.9.x of NPM, but the default version which is getting installed is 3.5.2…
Raj Bhatia
  • 889
  • 4
  • 12
  • 27
14
votes
1 answer

TypeError: t.fx is undefined when attempting to add jQuery-UI to Angular 4 app

I am trying to add jQuery-UI to an application, as I need access to some sliders. I have installed the typings for jQuery with: npm install @types/jquery --save And what seem to be the jQuery-UI typings with npm install @types/jqueryui --save I…
user7630939
14
votes
3 answers

Configuration for create-react-app after ejecting to build a component library

I started to build a component library that I want to publish on NPM (and reuse in other apps) by creating a React app using create-react-app. Unfortunately the create-react-app default configuration doesn't seem to support building such component…
Zardoz
  • 14,339
  • 21
  • 79
  • 126
14
votes
2 answers

npm install Error: EPERM: operation not permitted, symlink '../mkdirp/bin/cmd.js'

Still failed even after reinstall node and npm. Here is the full error message npm ERR! Linux 4.8.0-34-generic npm ERR! argv "/home/lt1pchanifa/.nvm/versions/node/v6.9.3/bin/node" "/home/lt1pchanifa/.nvm/versions/node/v6.9.3/bin/npm" "install" npm…
Edwin Harly
  • 379
  • 1
  • 3
  • 13
14
votes
9 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
  • 625
  • 1
  • 8
  • 19
14
votes
2 answers

How to compile typescript into javascript then into 1 file using npm scripts

My current entire package.json file. "scripts": { "build": "webpack", "start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\"", "lite": "lite-server", "postinstall": "typings install", "tsc": "tsc", "tsc:w": "tsc…
Leon Gaban
  • 27,845
  • 80
  • 281
  • 473
14
votes
7 answers

How do I install Angular 2 using NPM?

I'm trying to setup my own local development environment for an Angular 2 app without using the QuickStart seed mentioned in the Angular 2 site or the Angular CLI because they tend to come with extra files that I don't really require. Now,…
pdanem
  • 149
  • 1
  • 1
  • 4
14
votes
5 answers

How to specify different readme files for github and npm

Both use the README.md as the description when you publish. A common practice is to use a single shared file. But what if I need to have the different Readme and still publish it from a single local repo with no manual editing/replacement PS I…
Oleg Pro
  • 1,694
  • 1
  • 10
  • 22
14
votes
2 answers

how to render a react component using ReactDOM Render

_Header (cshtml)
export default class Help { ReactDOM.render( , document.getElementById('Help') ); } Help.js (component) } My goal is to render a help button on…
LOKI
  • 281
  • 1
  • 4
  • 14
14
votes
3 answers

Dev dependencies vs dependencies in node.js

In a node project I found 2 kind of dependencies: "dependencies": { "axios": "0.9.1", "express": "4.13.4", "lodash": "4.6.1", "react": "^0.14.7", "react-dom": "^0.14.7", "react-redux": "^4.4.0", …
Maria Jane
  • 1,963
  • 6
  • 17
  • 34
1 2 3
99
100