Open jamiewinder opened 7 years ago
I have exactly the same issue under Ubuntu/Linux. yarn v0.21.3
I get the error, but everything seems to have been published successfully.
OSX 10.11.6 yarn v0.24.5
Same here, fails with a 201 error
Getting the same error.
verbose 5.4 Performing "PUT" request to
Getting status 201 and error with Proget as npm registry. Have to use npm to publish as workaround.
verbose 2.937 Performing "PUT" request to "https://xxx.visualon.de/npm/vo-npm/@types%2fvo-app-base".
verbose 3.442 Request "https://xxx.visualon.de/npm/vo-npm/@types%2fvo-app-base" finished with status code 201.
verbose 3.449 Error: Couldn't publish package.
at C:\Program Files (x86)\Yarn\lib\yarn-cli.js:77664:13
at Generator.next (<anonymous>)
at step (C:\Program Files (x86)\Yarn\lib\yarn-cli.js:91:30)
at C:\Program Files (x86)\Yarn\lib\yarn-cli.js:102:13
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
error Couldn't publish package.
info Visit https://yarnpkg.com/en/docs/cli/publish for documentation about this command.
Warning: Use --force to continue.
Same issue here, also receiving status code 201 and then the error, but the package gets published anyways.
Same here, but with status code 202 (accepted) using TFS as an NPM registry.
verbose 0.758 Performing "PUT" request to "http://<redacted>".
verbose 1.164 Request "http://<redacted>" finished with status code 202.
verbose 1.18 Error: Couldn't publish package.
at MessageError (/usr/local/Cellar/yarn/1.3.2/libexec/lib/cli.js:139:5)
at /usr/local/Cellar/yarn/1.3.2/libexec/lib/cli.js:82746:13
at next (native)
at step (/usr/local/Cellar/yarn/1.3.2/libexec/lib/cli.js:92:30)
at /usr/local/Cellar/yarn/1.3.2/libexec/lib/cli.js:103:13
at process._tickCallback (internal/process/next_tick.js:103:7)
error Couldn't publish package.
MyGet returns 201 causing yarn publish
to fail despite the package being successfully published.
I am still seeing this issue with yarn 1.3.2.
Same problem here, using Nexus as npm registry.
Running yarn publish --verbose
results in the following output
verbose 0.352 Performing "PUT" request to "http://nexus.../content/repositories/npm-internal/oli-playground".
verbose 0.386 Request "http://nexus.../content/repositories/npm-internal/oli-playground" finished with status code 201.
res undefined
verbose 0.387 Error: Couldn't publish package.
The PUT request returns a 201 status code but the body is empty (I logged the response in the above output and it's undefined). Shouldn't yarn check the status instead of the body to determine if the request is successful ?
@BYK I have created a PR for this issue. Either this fix is trivial like in my PR, or I am missing something (for example compatibility with classic NPM repo).
Nexus here, fails as above, i.e.
Error: Couldn't publish package.
It hasn't gone ahead and published it despite the error. Using workspaces + lerna, I've basically had to switch to npm as the lerna client just for the publish step... not sure how else to fix this.
Same problem here under Ubuntu 16.04 and Yarn 1.6.0. It even doesn't create an error log to say what's exactly wrong. It just finishes with Error: Couldn't publish package.
Time for npm again :-(
Looks like this is happening in Circle CI's environment, too: https://circleci.com/gh/convoyinc/graphql-client-benchmarks/19
@brendan-hurley @medihack I just had the same issue and looks like yarn publish not respecting publishConfig in package.json.
When used with lerna
- setting explicit --registry
argument fixed the issue, ex: lerna publish --registry http://your.repo.host/repository/npm-private/
.
Also, if you're publishing namespaced packages - you may add namespace configuration to .npmrc
(which is used by yarn):
@mycustomns:registry=http://your.repo.host/repository/npm-private/
Both variants did work on a Jenkins server. Hopefully this may help you.
Maybe, your problem is not :cat2: Yarn, it's NPM service. These days NPM are invalidating tokens for a received attack.
$ npm publish
npm WARN notice Due to a recent security incident, all user tokens have been invalidated. Please see https://status.npmjs.org/incidents/dn7c1fgrr7ng for more details. To generate a new token, visit https://www.npmjs.com/settings/~/tokens or run "npm login".
npm ERR! publish Failed PUT 403
npm ERR! code E403
$ yarn publish
yarn publish v1.6.0
...
error Couldn't publish package.
info Visit https://yarnpkg.com/en/docs/cli/publish for documentation about this command.
I was getting this because I had enabled two factor authentication after the npm security incident. Running npm publish
gave me an additional prompt to enter the 2FA code.
It seems yarn doesn't support this yet. More info can be found at https://github.com/yarnpkg/yarn/issues/4904
Now we get the following on renovatebot
Package published but yarn failed with ESOCKETTIMEDOUT
What's causing this?
same problem ...I tried again adding the access
param ...and worked
yarn publish --access=public
Using yarn 0.20.3 on Windows, I'm publishing my module using
yarn publish
..It does publish something, but it seems to be an incomplete package. I have the following in my package.json:
And indeed it seems to publish them, but
dist
- a directory - is empty. It looks like the contents is being ignored, and the publish fails as a result?