np icon indicating copy to clipboard operation
np copied to clipboard

EPERM when publishing public scoped package with 2FA

Open tusbar opened this issue 6 years ago • 5 comments

Description

5.1.0 seems to break yarn publish with 2FA. 5.03 asks for OTP, 5.1.0 just crashes.

Commit Range:
v2.3.0...master

? Select semver increment or specify new version minor  2.4.0

  ✔ Prerequisite check
  ✔ Git
  ✔ Bumping version using Yarn
  ✔ Prerequisite check
  ✔ Git
  ✔ Bumping version using Yarn
  ✖ Publishing package using Yarn
    → The project was rolled back to its previous state.
    Pushing tags
    Creating release draft on GitHub

✖ Error publishing package:
Command failed with exit code 1 (EPERM): yarn publish

The project was rolled back to its previous state.
np --yolo  4.34s user 0.87s system 50% cpu 10.274 total

Package is public and scoped.

Steps to reproduce

Run np (example above was run with --yolo - but it doesn’t change the outcome)

Expected behavior

Should ask for OTP like in 5.0.3

Environment

np - 5.1.0 Node.js - 10.16.3 yarn - 1.19.0

tusbar avatar Oct 03 '19 13:10 tusbar

I'm seeing the same thing.

rdmurphy avatar Oct 05 '19 00:10 rdmurphy

I am also seeing this error when trying to publish from a subdirectory. Running yarn publish dist manually works however.

fubhy avatar Oct 05 '19 00:10 fubhy

I see this error, and some other strangeness, not in a subdirectory

  • with 5.1.0, without 2FA enabled, EPERM
  • with 5.1.0, with 2FA enabled,
  • with 5.0.3, with 2FA enabled ESOCKETTIMEDOUT instead.

I experienced the same thing when using yarn to manually attempt the underlying commands, then I used npm for the publish and it worked

🤷‍♂ - not sure this is an 'np' problem, I will attempt to run it as np --no-yarn next time (even though we use yarn in general in the module)

mikehardy avatar Oct 06 '19 15:10 mikehardy

Has anyone know how to fix this issue? Have been getting stuck from publishing patch release due to this.

raviSussol avatar May 20 '21 03:05 raviSussol

This has been working for me recently? Here is the comment I left myself on related issue

yarn shipit is working for me now, even with 2FA on, but I have to do an npm login pretty recently before I attempt it or I get an EPERM. So that's my workflow now.

I notice that np prompts me for 2FAs now and when I enter them it works? For auto-releases I'm not sure exactly how we're doing it but our release-bot is working as well - if there's anything useful for you to look at on react-native-device-info module on either npmjs.com or github .github/workflows maybe that helps?

mikehardy avatar May 20 '21 14:05 mikehardy