Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibility to pass additional flags to npm publish #590

Closed
sullenor opened this issue Feb 9, 2017 · 6 comments
Closed

Possibility to pass additional flags to npm publish #590

sullenor opened this issue Feb 9, 2017 · 6 comments

Comments

@sullenor
Copy link

sullenor commented Feb 9, 2017

I faced with this issue when I wanted to make an initial publish of the scoped package.

According to the npm docs I have to use npm publish --access=public command in that case. So I wonder if there is any possibility to pass additional flags to npm with lerna publish command?

@sullenor sullenor changed the title Possibility to pass additional arguments to npm publish Possibility to pass additional flags to npm publish Feb 9, 2017
@doug-wade
Copy link
Contributor

I thought you could pass extra arguments to npm after a -- switch, e.g. lerna publish -- --access=publish, but looking through the code, it doesn't seem like that's the case. It does seem like something we should support (using a scope seems like a great way to group lerna packages). It does look like as a workaround, you can use npm access public after the fact, so I'm labeling this an enhancement.

@sullenor
Copy link
Author

@doug-wade I think a -- switch is a good and well known solution. As far as I know minimist supports it and meow, which is used in lerna, uses minimist to parse the arguments.

If you require any help, let me know. Thanks.

@ef4
Copy link

ef4 commented Jul 17, 2017

It does look like as a workaround, you can use npm access public after the fact, so I'm labeling this an enhancement.

This workaround only works if you're on a paid npm account. If you're not, attempting to publish the new private package fails, and leaves your lerna publish in a half-finished state.

@evocateur
Copy link
Member

Add a publishConfig block to the package.json of the scoped package you wish publish publicly:

{
  "publishConfig": {
    "access": "public"
  }
}

ognen added a commit to netceteragroup/skele that referenced this issue Aug 31, 2017
@Bamieh
Copy link

Bamieh commented Dec 13, 2017

this would also solve #1137

@lock
Copy link

lock bot commented Dec 27, 2018

This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants