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
6
votes
0 answers

How to debug a TypeScript library using Chrome Dev Tools?

I have created a TypeScript library that has been published to npm using the following structure: mobx-state-router |--- package.json |--- src | `--- index.ts (TypeScript source) `--- dist |--- index.js (compiled JavaScript) …
Naresh
  • 23,937
  • 33
  • 132
  • 204
6
votes
0 answers

How to NPM publish so that consumers can imports from different top-level directories

I am publishing a library to NPM. The library was written in Typescript, and the result of the Typescript compilation is put in a lib/ folder. The main file is an index.ts that exports my public API: export * from './functions'; export * from…
BeetleJuice
  • 39,516
  • 19
  • 105
  • 165
6
votes
2 answers

React component with hooks as npm module

When I try to use React Hooks in module which I use as dependency it's fail. I'm getting a following error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following…
Twist
  • 235
  • 4
  • 10
6
votes
2 answers

npm can not publish my module

I am trying to publish my module to see how it works. I installed npm and then created my very simple module. I used npm add user to add myself as a new user. I received the following message: Logged in as david1994 on https://registry.npmjs.org/…
5
votes
0 answers

npm packaging without an entry point

I plan to publish a JavaScript library as an npm package and I have a question regarding packages entry points and best practices: what would be the best practice when a package doesn't expose a single entry point? Explicitly declare exports…
Monad
  • 85
  • 3
5
votes
0 answers

NPM publish/pack doesn't include content from symlinked directories on Windows

NPM doesn't follow directory symbolic links, nor directory junctions. Is there some configuration or way to force NPM to include also files from such directories? Minimal reproducible example. Folder structure: hello/ ├── foo/ │ └── foo.js └──…
tenbits
  • 7,568
  • 5
  • 34
  • 53
5
votes
1 answer

How to publish js + assets files to npm

I've developed a small Ui component for internal use in a company and published it to npm but when I install that package I only get an index.js file in node_modules folder. I'm not using any package builder, es-modules, just a straightforward .js…
Andrew
  • 1,507
  • 1
  • 22
  • 42
5
votes
0 answers

publish typescript library with paths & tsconfig-paths

I wanted to put shared common code into a private npm registry. Using the below commands & tsconfig has been working great, until I've wanted to make one project depend on another through publishing to an npm registry. I have several folder and a…
Mtfbwm2
  • 51
  • 1
5
votes
2 answers

How to create a JavaScript Library

I've created some functions in JavaScript. I've found out that I reuse them in many projects. So I decided to create a small JavaScript Library for my coding. A Library like react, react-dom, jquery which I can install with npm: npm install…
5
votes
0 answers

Export submodules instead of all components in the root with tsdx

Current Behavior We are building shared-code projects with tsdx, and we only have one doubt, concern we can't get an answer. How to export subfolders for packages published with TSDX. Let's use my previous example for the question. In the entry…
robertovg
  • 1,018
  • 11
  • 16
5
votes
0 answers

npm publish: verbose stack Error: 400 Bad Request

I use npm publish return the error 400 Bad Request, I tried the method with next steps: delete node_modules npm cache clean -f npm install npm audit But its not working. If you have the same trouble or solution method,please tell me,thanks! My env…
clark
  • 51
  • 2
5
votes
1 answer

Component library that's depending on a third part library or framework

Let's say that I have a component library with buttons, input fields and more complex components as well, that I want to distribute via npm so that I can use it in a lot of different "Parent Projects" in order to get the same look and feel…
Mike
  • 443
  • 9
  • 26
5
votes
1 answer

How to add npm dependency with tilde or caret during npm install

I developed an npm module (let's call it module-x) that I regularly update and publish on the npm platform. Software that uses this module installs it by running npm i module-x but in dependencies section of the package.json the module-x is…
5
votes
2 answers

Only npm publish when version changes in tfs build

I have created a private npm package which is published to Azure Artifacts. To publish my npm package I have a npm publish step in my tfs build definition. I am using tfs version 16.131.28507.4. This all works as intented. However, if a build is…
Michael Hancock
  • 2,673
  • 1
  • 18
  • 37
5
votes
2 answers

Npm publish to private scope keeps failing

I've recently created a new Organization and went for the paid plan to publish unlimited private packages. However, each time I try to publish my package to my Org, it keeps giving me the following error: npm ERR! publish Failed PUT 403 npm ERR!…
Cédric Bloem
  • 1,447
  • 3
  • 16
  • 34
1 2
3
26 27