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

Do I need to run `npm run prod` on production?

Laravel ships with a package.json file for npm. The default package.json only ships with devDependencies. npm run development is used to bundle all dependencies with web pack into a single file on local development, which is then pushed via…
Adam
  • 25,960
  • 22
  • 158
  • 247
21
votes
4 answers

linux-x64 binaries cannot be used on the linuxmusl-x64 platform error

I'm installing the Sharp package for image compression on the docker image for a Nodejs project with package.json. When I create the container I get the following error regarding to the sharp package: /app/node_modules/sharp/lib/libvips.js:67 throw…
Farzaneh Torkpichlou
  • 2,306
  • 3
  • 14
  • 18
21
votes
7 answers

Run single test of a specific test suite in Jest

I have a file called "test-file-1", within it i have a few describes (test suites) with unique names and inside them i have tests which may have similar names across test suites. To run a single test suite or test i type the command below. npm test…
Gabriel Souza
  • 965
  • 5
  • 16
  • 36
21
votes
5 answers

create-react-app "Failed to compile" on start up

I am getting the following error when using npm start to open create-react-app. I'm new to React and I have had no problems the past few days doing the command line to make a new app. I have tried npx start, npm start and installed npm again for the…
DGB
  • 1,252
  • 2
  • 16
  • 32
21
votes
3 answers

How to source shell script with npm scripts?

I have a script in my package.json: { "scripts": { "start": "source run-nvm.sh && ..." } } But running source run-nvm.sh && ... is different to yarn start (or npm run start). Why? It creates a subshell. So I can't change environment of the…
Jerry Green
  • 1,244
  • 1
  • 15
  • 25
21
votes
2 answers

Yarn won't use specified registry

After running yarn config set registry https://registry.yarnpkg.com/, Yarn continuously uses the wrong registry--in this case, https://registry.npmjs.org/. Here is the output from yarn config list: yarn config v1.13.0 info yarn config {…
navig8tr
  • 1,724
  • 8
  • 31
  • 69
21
votes
9 answers

request to https://registry.npmjs.org/co failed

If I do npm install in my repository. I get the below error npm ERR! code UNABLE_TO_GET_ISSUER_CERT_LOCALLY npm ERR! errno UNABLE_TO_GET_ISSUER_CERT_LOCALLY npm ERR! request to https://registry.npmjs.org/co failed, reason: unable to get local issuer…
Thangakumar D
  • 714
  • 5
  • 12
  • 27
21
votes
5 answers

Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1

i am trying to install all dependencies using npm install command, but while installing it i am getting error like below : ling source file ..\src\threaded_callback_invokation.cc) c:\applatest\applatest\node_modules\nan\nan.h(1478): warning C4996:…
sejal
  • 221
  • 1
  • 2
  • 4
21
votes
1 answer

Why must I run "npm install" twice for my package to install successfully

The first time I "npm install" package_1, I get the following error. npm ERR! path C:\Users\john_\Documents\GitHub\why_npm_nesting_fails\package_1\node_modules\.staging\bignumber.js-55edd243 I don't use "bignumber" so assume it's a MySQL…
grabbag
  • 980
  • 1
  • 15
  • 33
21
votes
2 answers

How do I resolve npm audit returning ENOAUDIT: Your configured registry does not support audit requests?

This recently broke and I do not know what I might have done to break it beyond adding some additional dependencies. I am using https://registry.npmjs.org/ (the default). The relevant portion of the log file is below. Has anyone seen something…
ChiralMichael
  • 1,214
  • 9
  • 20
21
votes
5 answers

ReactJS: Pngquant failed to build, make sure that libpng-dev is installed

I am trying to setup a react project. It has lot of dependencies and while downloading one of module it is throwing this error. This is on windows. pngquant failed to build, make sure that libpng-dev is installed Output: ‼ unable to get local issuer…
Santosh b
  • 729
  • 1
  • 8
  • 19
21
votes
3 answers

npm uninstall removes the package from package.json but doesn't remove it from node_modules folder

I have tried to remove a package by using npm uninstall (package_name) -s Which removed the package from package.json but didn't remove it from node_modules folder, so how can I remove these unused package from node_modules folder? Edit: I am…
Ahmed Elkoussy
  • 8,162
  • 10
  • 60
  • 85
21
votes
2 answers

Difference between Express and Connect npm packages

I have been using express webservers since I started working on Node.js and a few days ago I came across this new (to me) web server, called connect. Can anyone point out, what are the differences between the express and connect? When should we use…
Harshal Yeole
  • 4,812
  • 1
  • 21
  • 43
21
votes
4 answers

Angular / create a module, component without css file in one command?

Is there such an option to create a Module that is linked to a component, which does not have a css file upon creation? e.g. The default way of doing this for me so far is the following: ng generate module name / ng generate component name And I get…
Tanasos
  • 3,928
  • 4
  • 33
  • 63
21
votes
1 answer

Override `npm install` script for NPM project

I have an NPM project, when npm install is run, I'd like to run a custom script. I tried using this in package.json: "scripts": { "ng": "ng", "start": "ng serve", "install": "./scripts/install.sh", // <<<< }, but that actually just…
Alexander Mills
  • 90,741
  • 139
  • 482
  • 817
1 2 3
99
100