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
22
votes
3 answers

NPM : Cannot find module 'node-gyp/bin/node-gyp'

I'm using NPM under my ubuntu 14.04 and node 8.0.0 . I have upgraded my npm from 5.2.0 to 5.6.0 but after that all npm commands are failing , indicating a problem of : node-gyp/bin/node-gyp The complete log is the following : npm ERR! code…
firasKoubaa
  • 6,439
  • 25
  • 79
  • 148
22
votes
1 answer

How to debug npm install execution

What´s the recommended way of debugging an npm install operation? I have an exception being throw (similar to https://github.com/hyperform/hyperform/issues/63 or https://github.com/npm/npm/issues/17858) and would like to know how to debug the source…
22
votes
1 answer

VS Code IntelliSense enabled when developing inside a Docker container

I'm wondering whether it is possible to have VS Code IntelliSense enabled when developing inside a Docker container where all the dependencies are locally installed?
John Gray
  • 221
  • 2
  • 4
22
votes
4 answers

JavaScript function is not defined with Laravel Mix

First , code in resources/js/app.js function button1Clicked(){ console.log('Button 1 is clicked'); } Second , code in testing.blade.php
YChen
  • 221
  • 1
  • 2
  • 3
22
votes
8 answers

npm install npm -g won't update npm to the latest version

I am using npm v5.3.0. Now I want to update npm to v5.4.1.To do this I type the following in my terminal: npm install -g npm without any errors.However when I type npm -v the version I get is the 5.3.0 not the 5.4.1 I have to mention that I have…
Manos Kounelakis
  • 2,848
  • 5
  • 31
  • 55
22
votes
1 answer

how to import all css of node_modules in vuejs

I am building a Vue.js app starting with the webpack template and vuetify. To import vuetify css Im doing this in my App.vue Is this the correct or only way? because it…
Diego Manjarrés
  • 231
  • 1
  • 2
  • 4
22
votes
3 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
  • 515
  • 1
  • 5
  • 16
22
votes
5 answers

Detect circular dependencies in project

Last time i found in my project problem with circular dependencies. I resolve my problem but, i would like avoid this in future. I think about plugin which found circular dependencies in my all project and give me feedback. Example: File a.js: var…
new_user
  • 255
  • 1
  • 2
  • 10
22
votes
8 answers

How to use private NPM packages with cloud functions?

I'm trying to switch an application to Firebase and transfer the backend to Firebase Cloud Functions. This application is using a private package (@org/name) as a dependency. I've tried different solution, but none seems to work: Pass a NPM_TOKEN…
Samy Pessé
  • 447
  • 4
  • 9
22
votes
1 answer

Why eslint can't detect all files in the directory, but can detect single file?

This is my directory structure. I want to config some eslint rule to detect my code. In .eslintrc, I write these configuration items. { "extends": "airbnb", "rules": { "valid-jsdoc": 2, // Disable until Flow supports let and const …
qiuyuntao
  • 2,314
  • 4
  • 19
  • 24
22
votes
5 answers

Task "default" is not in your gulpfile

I run gulp in my console I got this error: Task 'default' is not in your gulpfile My gulpfile looks just fine: var gulp = require('gulp'), LiveServer = require('gulp-live-server'), browserSync =…
Jessie Emerson
  • 743
  • 4
  • 12
  • 25
22
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
  • 2,323
  • 1
  • 15
  • 23
22
votes
3 answers

npm package.json main and project structure

I have a issue with npm and the main field. I see the documentation and as of my understanding I point main to be a different entry point than ./index.js. I already tested the package where all dist files are inside the root folder. I ignore src and…
jonas.hartwig
  • 857
  • 3
  • 8
  • 19
22
votes
6 answers

TypeScript: Extend Express.Session interface with own class

I'm working on a Typescript project with npm packages. I want to add a property to the Express.Session interface. example Class: class User { name: string; email: string; password: string; } export = User; New d.ts file for the…
Mr. Smith
  • 559
  • 1
  • 5
  • 17
22
votes
1 answer

npm run does nothing

I've been working with Node.js/npm for a while, but I never used npm scripts. I was quite surprised to find that I can't get them to work at all on my Windows/Cygwin system. With a package.json like this ... { "name": "demo", "scripts": { …
wortwart
  • 3,139
  • 27
  • 31