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
0
votes
1 answer

How to host TS declaration file package on private npm registry

RT I want to host TS declaration file package (start with scope @types) on private environment. Used two ways: Host it on private npm registry directly. Cannot install it from specific registry without affect to other packages in @types…
Woody
  • 33
  • 1
  • 5
0
votes
1 answer

Use NPM publish with Gitlab

I'd make my first npm publish into my Gitlab project. The project is private so I generated a deploy token with read & write permission for package registry. Locally I created an .npmrc file and used these…
Dadinho
  • 57
  • 7
0
votes
2 answers

I am trying to export my npm package. How to do it properly?

I've created an npm package class Person { constructor() {} sayHello() {console.log("Hello World!")} } module.exports = Person; After doing npm i my-package it was added the lib to my project. On my index.js I am doing the…
Moyshe Zuchmir
  • 1,522
  • 12
  • 18
0
votes
2 answers

Azure pipeline for npm publish does not work as expected

I am a bit new to azure and today I am trying to create a pipeline for publishing npm package to azure artifactory. The issue is - that after pipeline successfully built, I can see the published package in the artifacts. However, published package…
Sh. Pavel
  • 1,584
  • 15
  • 28
0
votes
0 answers

Can we use github tag as dependency in package.json without npm publish?

I am new to nodejs. Currently, I have a nodejs repo and released in github with tag as x.y.z but this is not published to npm. Is it possible to use x.y.z version in package.json as a dependency?
0
votes
2 answers

Github action npm publish use tag name

I'm migrating our existing Travis tasks to GH actions. For Travis the command below would publish to npm and use the release tag name for the npm version. script: yarn npm-bundle && npm version $TRAVIS_BRANCH --allow-same-version -m "chore -…
Matt Simon
  • 23
  • 5
0
votes
1 answer

Is it possible to share the type definition between React and AWS CDK node.js?

I'm using React and AWS CDK (nodejs) by typescript for my application. Because some parts take graphql, there are so many duplicated type definitions. (ex. To make 'Post' feature, I have to define the related types on front and back individually…
Noah Gray
  • 151
  • 1
  • 1
  • 13
0
votes
1 answer

NPM publish - install files as root files during npm install instead of inside node_modules

I am trying to publish a boilerplate project as an npm package. I have tried other solutions on the site. I want the below project files to be installed as root project files instead of node_modules. I want to publish the package in such a way that…
Tal
  • 1,091
  • 12
  • 25
0
votes
0 answers

Need Help To Publish NPM Typescript package

I've published the library but there's a problem. I need to do something like this to access my code: const { default: { getContrast }, } = require('@akashshyam/color-utilities/lib/index'); console.log(getContrast('#ffffff')); There are two…
Akash
  • 762
  • 7
  • 25
0
votes
0 answers

What causes NPM Publish Failure, "Parse Error: Invalid major version"

A package I maintain previously has had no issues, but just now started failing new publish attempts for a patch version update. My workflow is consistent, but now I am exiting just after the tarball details with npm ERR! code…
Kevin H.
  • 318
  • 2
  • 15
0
votes
1 answer

Jenkinsfile: monorepo with package dependencies

I am creating a monorepo which builds and publishes multiple npm packages to a local Artifactory. All within this monorepo, several npm packages have dependencies with another npm package create. The layout for this monorepo is as follows, and npm…
Jeff
  • 1,917
  • 1
  • 25
  • 43
0
votes
1 answer

"npm publish" not prevented despite errors being thrown in test script

If I'm not mistaken, one good reason to use test scripts is to prevent releasing buggy code. So I wrote my own test script which throws an error if one of the test cases fails. // index.test.js if (!testCase) { throw new Error("Error detected,…
gignu
  • 1,763
  • 1
  • 14
  • 24
0
votes
0 answers

How to package and publish a collection of TypeScript methods?

I am working on publishing a library of in-house methods that need to be made available to other projects. At the moment the library is basically a slew of individual method files. As a sample I've cherry picked a couple of simple methods that have…
Devin Rodriguez
  • 1,144
  • 1
  • 13
  • 30
0
votes
1 answer

Cannot consume private NPM package hosted on GPR

I have a private repo that, using Github Actions workflow, I have published as a private npm package on Github Package Registry. I want to consume this package in the scope of another private project of mine. But there is an issue. Upon importing…