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

npm ERR! code EUNSUPPORTEDPROTOCOL when using yarn's "workspace:" #129

Open
manast opened this issue Sep 9, 2022 · 7 comments
Open

npm ERR! code EUNSUPPORTEDPROTOCOL when using yarn's "workspace:" #129

manast opened this issue Sep 9, 2022 · 7 comments

Comments

@manast
Copy link

manast commented Sep 9, 2022

I am using yarn workspaces, and in order to depend one package to another in my monorepo I am using yarn's workspace protocol (https://yarnpkg.com/features/workspaces#publishing-workspaces)
However when trying to run multi-semantic-release it errors with the following:

npm ERR! code EUNSUPPORTEDPROTOCOL
npm ERR! Unsupported URL Type "workspace:": workspace:packages/dashboard

Reference:
https://github.com/taskforcesh/nandu/runs/8274785071?check_suite_focus=true#step:5:91

@manast
Copy link
Author

manast commented Sep 9, 2022

Update:
using workspace:* does not help either:

npm ERR! code EUNSUPPORTEDPROTOCOL
npm ERR! Unsupported URL Type "workspace:": workspace:*

If the workspace protocol is not supported, how do you guys manage intra module dependencies?

@manast
Copy link
Author

manast commented Sep 12, 2022

So last three days I spent trying to make the release to no avail... tried everything I could came up with. In the last iteration I changed to pnpm instead of yarn. Interestingly it works to make a dry releae locally, but not on github actions...

https://github.com/taskforcesh/nandu/actions/runs/3040480203/jobs/4896572401

By using custom semantic-release/npm with a never version of npm I manage to go a step further but then got stuck with another error impossible to understand: npm ERR! Cannot read properties of null (reading 'matches')\n"

https://github.com/taskforcesh/nandu/actions/runs/3040464168/jobs/4896538148

I do not expect to get any help at this point, but certainly if you read this and are considering to use monorepos and semantic-release, you may also spend several days like I did to no avail...

@aarne
Copy link

aarne commented Sep 13, 2022

get the /home/runner/.npm/_logs/* from actions and things will get more transparent i hope. Add something like this as the last step in your action.

      - name: Store error logs
        uses: actions/upload-artifact@v3
        if: failure()
        with:
          name: npm-logs
          path: /home/runner/.npm/_logs/

Also you can see the command executed that errored out npm version 1.0.0 --userconfig "/tmp/c4c21035de7032234bf3da5d11dbc535/.npmrc" --no-git-tag-version --allow-same-version. Running it manually might make it simpler to diagnose

@manast
Copy link
Author

manast commented Sep 13, 2022

@aarne Thanks. Yes, by uploading the log files I could see that the error came from "arborist" an internal module used by node itself. Downgrading to node 14 did the trick... although I did not investigate what is the root cause.

@aarne
Copy link

aarne commented Sep 13, 2022

@aarne
Copy link

aarne commented Sep 17, 2022

The problem is with npm starting from version 8.5 that comes by default with node 16.15.

Adding workspaces-update = false to your .npmrc will fix the issue on newer npm versions

@antongolub
Copy link
Collaborator

antongolub commented Sep 17, 2022

@aarne,

Thanks for the digging. We use yarn for our monorepos, so we have never faced with this kind of npm features. Could you pls update the readme.md troubleshooting section?

UPD I forgot that there is already such a mention. )))

npm v8.5+: npm ERR! notarget No matching version found for...
When releasing a monorepo you may get a npm ERR! code ETARGET error. This is caused by npm version creating a reify update on packages with future dependency versions MSR has not updated yet.
The simplest work around is to set workspaces-update to false either in your .npmrc or manually by running npm config set workspaces-update false

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

3 participants