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

How did I get 111 npm downloads already?

So 2 days ago I published my first npm package A simple library to trim and join audio files. https://www.npmjs.com/package/aviatojs\ The weird thing is I already got 111 downloads somehow. I havent shared this package with anyone Neither have I…
Ansh Malik
  • 162
  • 2
  • 7
11
votes
1 answer

Vue3 / Vite: How to package components for publishing on npm

I'm trying to export two web components in a public package on npm, using Vite with TypeScript. Vite has a Library Mode which works well. The ESM and UMD files are both being transpiled into my /dist directory. My question is how to export the web…
sparkyspider
  • 13,195
  • 10
  • 89
  • 133
11
votes
2 answers

Can't publish private npm package on Gitlab - E404 Not found PUT

I've tried many different docs and tutorials to publish a scoped npm package on a private gitlab instance. So far I've: Created a deploy token with package write & read permissions: Setup a .npmrc file with the following…
11
votes
3 answers

npm publish - removing scripts from package.json?

Before publishing my script, I have a number of scripts under the package.json to compile coffeescript, typescript and developer only commands - which make no sense once it's published. I was wondering if there is a procedure for removing certain…
Martin
  • 23,844
  • 55
  • 201
  • 327
10
votes
4 answers

I am getting 404 error while running "npm publish"

I am trying to publish a package to the npm registry. But when I hit the command npm publish I get this error. npm WARN prepublish-on-install As of npm@5, `prepublish` scripts are deprecated. npm WARN prepublish-on-install Use `prepare` for build…
Suraj Oberai
  • 304
  • 5
  • 14
10
votes
2 answers

How to package only the dist folder in a monorepo

I am using lerna and yarn workspaces in my monorepo. The package structure looks like this: root `--- packages |--- pkg1 | |--- src | | `--- index.ts | `--- dist | `--- index.js `--- pkg2 …
Naresh
  • 23,937
  • 33
  • 132
  • 204
9
votes
2 answers

npx does not look for latest version of package

I was making a simple npm package, I deleted the first version i.e, v0.1.0. So there is no v0.1.0 for my package. But I published later versions, with latest being v0.3.0. But when I execute npx , it does not install latest…
Nikhil
  • 91
  • 1
  • 5
9
votes
1 answer

How to split a typescript package into multiple submodules?

My newest typescript project is split into different modules and submodules. My file structure: package.json (...) /src | /module1 | | index.ts | | (...) | | /subModule1 | | | index.ts | | | (...) | | /subModule2 | | index.ts | | (...) |…
9
votes
2 answers

How do I publish a package to npm using an API key?

NPM gives the ability to create access tokens with the right to publish packages to the NPM registry, assuming that you've set the package settings to "Require two-factor authentication or automation tokens" in "Publishing access" (and so implicitly…
Chris Midgley
  • 1,452
  • 2
  • 18
  • 29
9
votes
2 answers

Error on updating packages in npm

I get this error when updating my package. "cannot be republished until 24 hours have passed" in nodejs
8
votes
1 answer

github action for npm publish fails

Goal I have manually published an open source lib to registry.npmjs.org and I want future releases to be automatically published using GitHub Actions. I have no prior experience with GitHub actions. What I have done so far I have put the standard…
observer
  • 2,925
  • 1
  • 19
  • 38
8
votes
2 answers

I published one package on npm, but it's not showing in the search list when i am going to search

I published one package as a public & i am trying to search it on npm (https://www.npmjs.com/), but there is no package available with that name on npm. Tried with: npm install package-name -> working fine Here is the package link:…
Krishna Ghatul
  • 198
  • 2
  • 12
7
votes
0 answers

Lerna publish : determine published generated version number

When running lerna publish within our pipeline like so : lerna publish --yes --force-publish=* --canary --preid 2760 --registry Is there a way of getting the actual published version of the artifact. One solution I can think of is trying to parse…
vanzylv
  • 841
  • 2
  • 10
  • 22
7
votes
2 answers

Publishing scoped npm package for free?

Am I correct that publishing a scoped npm package (@foo/bar), even as --access=public, is not free? It results in a Failed PUT 404 (or 402) error. Is this because one needs a (paid) npm organization @foo? Update (Mar '17): Npm organisations are now…
P Varga
  • 19,174
  • 12
  • 70
  • 108
6
votes
1 answer

npm publish fails with "The "path" argument must be of type string. Received undefined"

I have a project that i publish on a private npm repository. Under node v14.16.0 (npm v6.14.11), the command npm publish run well and my package is published on my private repository. I upgraded npm to 7 to support peer dependencies…
Troopers
  • 5,127
  • 1
  • 37
  • 64
1
2
3
26 27