cli
cli copied to clipboard
[BUG] git+ssh does not work with version 8.16
Is there an existing issue for this?
- [X] I have searched the existing issues
This issue exists in the latest npm version
- [X] I am using the latest npm
Current Behavior
Hello
Using the latest version of npm 8.16
and latest 14.20
version of node.js.
I have few dependencies which i install from local git server.
When i remove node_modules
folder and want to install packages again with command npm i
i get error:
2833 verbose stack TypeError [ERR_INVALID_URL]: Invalid URL: git+ssh://git@***:frontend/utils.git#6d45447e0c5eb6cd2e3edf05a8c5a9bb81950c79
2833 verbose stack at new NodeError (internal/errors.js:322:7)
2833 verbose stack at onParseError (internal/url.js:270:9)
2833 verbose stack at new URL (internal/url.js:346:5)
2833 verbose stack at Arborist.[registryResolved] (***/.nvm/versions/node/v14.20.0/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:721:25)
2833 verbose stack at Arborist.[extractOrLink] (***/.nvm/versions/node/v14.20.0/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:641:72)
2833 verbose stack at ***/.nvm/versions/node/v14.20.0/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:607:35
But with npm 8.15.1
is works fine.
Expected Behavior
Packages with git+ssh path should be installed
Environment
- npm: 8.16.0
- Node.js: v14.20.0
- OS Name: MacOS 11.6.8
- System Model Name: Macbook Pro
The same npm: 8.16.0 Node.js: v18.7.0 OS Name: Windows 11
Same here npm: 8.17.0 Node.js: v16.16.0 OS Name: Windows 11
Any news? 8.18.0 version already released
Same here. All our pipelines fail, I had to fix all NPM versions to 8.15.
i even get now errors like npm exec not working with packages anymore when one includes a git dependencie is in the packages it does fail silently
throw error ERR_INVALID_URL
in this line https://github.com/npm/cli/blob/fa014a5567566c764942600441a5e01c3e2f229b/workspaces/arborist/lib/arborist/reify.js#L721
node URL
not support parse git+ssh://
@VisonM I think that they need to use
const {parse}=require("node:url");
instead of global version of URL, because of Node.JS global URL is strict whatwg version, but Chromium is some patched version
@VisonM I think that they need to use
const {parse}=require("node:url");
instead of global version of URL, because of Node.JS global URL is strict whatwg version, but Chromium is some patched version
You are right. you can try send a fix pr. I'm not completely familiar with how npmcli works.
@VisonM created )
This is missing steps to reproduce. What entry in your package.json causes this?
This is missing steps to reproduce. What entry in your package.json causes this?
@wraithgar
For example in my case access to local git server.
You can try any lib source with git+ssh
"devDependencies": {
...
"etools": "git+ssh://git@git.***:frontend/dev-build-tools.git",
...
}
Any package comming from github or gitlab. For us that's a private gitlab repository, I can't link it here.
https://github.com/npm/cli/pull/5487#issuecomment-1247371710
@lazybobcat Just replace colon with slash as workaround
"devDependencies": {
...
"etools": "git+ssh://git@git.***/frontend/dev-build-tools.git",
...
}
I have the same problem and @Delagen workaround fixed it !
Still same problem exists! It's critical to use local git repositories! please write a test for this condition, is it possible to fix and commit it as soon as possible
Same issue with npm cli bundled with nodejs 16.18.0
This is a serious issue that needs to get fixed ASAP!
Is there a solution for gitlab url for https?like this: git+https://xxx.com/xxx/common-react-components.git#3.7.3
Is there a solution for gitlab url for https?like this: git+https://xxx.com/xxx/common-react-components.git#3.7.3
I had the same problem and @Delagen workaround fixed it !
有没有针对https的gitlab url的解决方案?像这样:git+ https://xxx.com/xxx/common-react-components.git#3.7.3
我遇到了同样的问题@Delagen 解决方法修复了它!
Did you change https to ssh and that solved it?
Sorry, I didn't read your problem well. What is your problem exactly ? Https doesn't work ?
I'm https now, how to fix it without modifying it to ssh way?