-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
[BUG] [DEP0170] DeprecationWarning for git+ssh:// dependencies #6869
Comments
Indeed, npm (and the ecosystem) will need a longer-term solution for URLs like this. |
@lukekarrys: This isn't a regression in 10.x, the 9.x series is affected as well (I suspect all NPM versions running on Node 20+ are). |
@dmke Thank you, I thought we switched URL parsers in the switch to npm@10 but that must have happened at a different time. |
This was fixed in |
Can confirm, updating to 10.2.0 fixes this issue. Thank you! |
I have same warning on npm 10.5.0 and nodejs 20.12.0 but im using #tag {
"dependencies": {
"something-private": "git+ssh://[email protected]:group/project.git#tag"
}
} |
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
On Node v20, DEP0170 is active:
It looks like npm tries to parse dependencies like
with
url.parse
, which in turn interpretsgroup
as port number.The NPM docs on Git URLs as Dependencies state:
Changing the dependency URL to
leads to Gitlab intepreting "22:group" as (non-existing) project namespace.
Expected Behavior
The warning should be addressed.
Since Node obviously seeks WHATWG URL API compatibility, there are a few options:
git+ssh
, where host/port and path are separated by a colon.Steps To Reproduce
See current behaviour above:
git+ssh://
URLnpm install
[DEP0170] DeprecationWarning: The URL git+ssh://... is invalid. Future versions of Node.js will throw an error.
Environment
The text was updated successfully, but these errors were encountered: