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

ENOWORKSPACES when publishing from workspace #715

Open
karlhorky opened this issue Sep 13, 2023 · 1 comment
Open

ENOWORKSPACES when publishing from workspace #715

karlhorky opened this issue Sep 13, 2023 · 1 comment

Comments

@karlhorky
Copy link
Contributor

karlhorky commented Sep 13, 2023

Description

Publishing one of the packages from a workspace like packages/react-scripts in a create-react-app fork leads to a ENOWORKSPACES error when running the npm config get registry command:

$ np --yolo

✖ Error: Command failed with exit code 1: npm config get registry
npm ERR! code ENOWORKSPACES
npm ERR! This command does not support workspaces.

npm ERR! A complete log of this run can be found in: /Users/k/.npm/_logs/2023-09-13T12_57_00_983Z-debug-0.log
    at makeError (file:///Users/k/Library/pnpm/global/5/.pnpm/[email protected]/node_modules/execa/lib/error.js:59:11)
    at handlePromise (file:///Users/k/Library/pnpm/global/5/.pnpm/[email protected]/node_modules/execa/index.js:124:26)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Module.getRegistryUrl (file:///Users/k/Library/pnpm/global/5/.pnpm/[email protected]/node_modules/np/source/npm/util.js:154:19)
    at async ui (file:///Users/k/Library/pnpm/global/5/.pnpm/[email protected]/node_modules/np/source/ui.js:129:22)
    at async file:///Users/k/Library/pnpm/global/5/.pnpm/[email protected]/node_modules/np/source/cli-implementation.js:137:18

This is a regression since a few months - in April / May 2023 we were able to publish these packages without problems.

Steps to reproduce

  1. np --yolo or np in a package inside of a workspace

Expected behavior

np works in a package inside of a workspace without errors

Environment

np - 8.0.4
Node.js - 18.17.1
npm - 9.6.7
Git - 2.39.2
OS - macOS Ventura 13.5.2

@karlhorky
Copy link
Contributor Author

Workaround (complicated)

  1. Move workspace package outside of the monorepo
  2. Create new GitHub repo
  3. git init
  4. git remote add origin <repo remote URL>
  5. git push --set-upstream origin main
  6. np

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant