Questions tagged [npm-publish]

npm publish is command on npm CLI, which publishes the specified package to the npmjs repository and then can be available to install through npm install command.

is a package manager for .

npm publish <packagename> is a command on npm CLI, which publishes the specified package to the npmjs repository. Published packages can then be installed via the command, i.e. npm install <packagename>

Reference:

396 questions
183
votes
6 answers

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 persist those changes on npm install. A colleague…
hughesjmh
  • 2,133
  • 2
  • 11
  • 11
118
votes
20 answers

Getting 404 when attempting to publish new package to NPM

I just created a new package. I'm now trying to publish it to NPM for the first time like this: ole@MKI:~/Sandbox/pli$ npm publish --access public npm ERR! publish Failed PUT 404 npm ERR! Linux 3.13.0-93-generic npm ERR! argv…
Ole
  • 41,793
  • 59
  • 191
  • 359
101
votes
16 answers

How to set npm credentials using `npm login` without reading from stdin?

I'm trying to automate npm publish inside a Docker container, but I receive an error when the npm login command tries to read the username and email: npm login << EOF username password email EOF It works in a Bash terminal, but in a container…
shawnzhu
  • 7,233
  • 4
  • 35
  • 51
56
votes
2 answers

How npmjs.com calculates the code quality

When we publish a package to npm, it will show us some data such as popularity, quality, and maintenance in the search page (The example image is blow). I just wonder how npm calculates the quality? Really appreciate if someone can give some clue.…
Kevin
  • 1,271
  • 9
  • 14
56
votes
3 answers

How to set _auth for a scoped registry in .npmrc?

I am wondering how to configure the .npmrc file so that I can have a default registry and a different scoped registry with authentication. I am using Nexus for the private repository and I am not sure how to set authentication for the scoped…
Willem van Ketwich
  • 5,666
  • 7
  • 49
  • 57
50
votes
7 answers

npm publish causes 'Error: EPERM: operation not permitted, unlink ...', errno -4048

I'm trying to publish my NPM package: npm publish. I get the following quite cryptic error: npm ERR! path c:\Temp\npm-20936-b98f84c8\tmp\fromDir-02dd5394\package.tgz npm ERR! code EPERM npm ERR! errno -4048 npm ERR! syscall unlink npm ERR! Error:…
Vaiden
  • 15,728
  • 7
  • 61
  • 91
34
votes
8 answers

You cannot publish over the previously published versions

I've updated my package using npm version minor to go from 0.4.0 to 0.5.0, and both package.json and package-lock.json reflect this. However when I run the npm publish command it says: You cannot publish over the previously published versions:…
user1795832
  • 2,080
  • 8
  • 29
  • 50
33
votes
1 answer

How to publish NPM Scoped Packages / NPM scope not found?

I want to start publishing npm packages to a scope. Do I need to register as a user with the scope as my user name? Example if I create a package like this: ole@MKI:~/firstpackage$ npm init Use `npm install --save` afterwards to…
Ole
  • 41,793
  • 59
  • 191
  • 359
24
votes
4 answers

How to generate NPM release candidate version

Say I want to generate a pre-release NPM version. Originally I have this: "version": "0.0.1" I tried: npm version prepatch npm version prepatch npm version preminor npm version preminor that gave me…
Alexander Mills
  • 90,741
  • 139
  • 482
  • 817
14
votes
4 answers

Minified React error #321; visit https://reactjs.org/docs/error-decoder.html?invariant=321

I am trying to create few react components with few custom changes as package and publish into npm so that other projects can use them by importing package. My package is "sample-testing" available at…
HimaaS
  • 413
  • 3
  • 6
  • 13
14
votes
8 answers

NPM: 403 forbidden - PUT http://registry.npmjs.org/[package-name] - Forbidden

I am trying to create npm vue component library. I have been working through all the steps but stuck at npm publish. Please see the below error screenshot for which I am unable to find a solution on google after trying more than an hour(The error…
Satyam Pathak
  • 6,612
  • 3
  • 25
  • 52
14
votes
1 answer

Does npm publish perform an npm pack

Considering the Node.js package manager, namely npm - I was curious if the publish command performs the pack command prior to the publish or if it does something different altogether? So if I were to execute: npm publish Does it first…
David Pine
  • 23,787
  • 10
  • 79
  • 107
13
votes
1 answer

npm publish a package with only the children of dist folder

My package is structured as follows: mypackage |--- src | |--- component1 | `--- component2 `--- dist |--- component1 `--- component2 When I publish it to npm, I would like it to look like the following,…
Naresh
  • 23,937
  • 33
  • 132
  • 204
12
votes
3 answers

npm publish fails with GitLab NPM registry

I have tried to make use of the new NPM registry that's now part of the free GitLab edition. I am attempting to create a NPM package and publish it on our company's GitLab instance. When attempting to run npm publish, the process exits with the…
Manny
  • 783
  • 1
  • 9
  • 29
11
votes
1 answer

peerDependencies configuration for publishable libraries with NX & Angular

I have a monorepo using NX & Angular and I am publishing some libs to NPM and i have the following scenario apps only_App libs lib_A // v1.0.0 lib_B // v1.0.0 lib_C // v1.0.0 lib_A depends on lib_B and lib_C. In the pre-built…
Pato
  • 189
  • 1
  • 9
1
2 3
26 27