Не удается установить git хранилище через `npm install` с NPM версией 3 - PullRequest
0 голосов
/ 21 февраля 2020

Можно ли использовать Node v6 (поставляется с NPM 3) и NPM 6?

Причина, по которой я должен это сделать, заключается в том, что у меня есть устаревший проект, требующий использования Node v6, и я хочу npm установить мой репозиторий GitLab на моем сервере, например:

npm install git+http://<my-deploy-token-name>:<my-deploy-token-password>@my-gitlab-domain/my-name/my-project-name#v0.0.2

Это не удалось на NPM v3, но успешно на NPM v6.

Полностью npm -debug.log:

0 info it worked if it ends with ok
1 verbose cli [ '/Users/wangzhiyong/.nvm/versions/node/v6.17.0/bin/node',
1 verbose cli   '/Users/wangzhiyong/.nvm/versions/node/v6.17.0/bin/npm',
1 verbose cli   'install',
1 verbose cli   'git+http://<my-deploy-token-name>:<my-deploy-token-password>@my-gitlab-domain/my-name/my-project-name#v0.0.2' ]
2 info using npm@3.10.10
3 info using node@v6.17.0
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly fetchPackageMetaData git+http://<my-deploy-token-name>:<my-deploy-token-password>@my-gitlab-domain/my-name/my-project-name#v0.0.2
8 silly fetchOtherPackageData git+http://<my-deploy-token-name>:<my-deploy-token-password>@my-gitlab-domain/my-name/my-project-name#v0.0.2
9 silly cache add args [ 'git+http://<my-deploy-token-name>:<my-deploy-token-password>@my-gitlab-domain/my-name/my-project-name#v0.0.2',
9 silly cache add   null ]
10 verbose cache add spec git+http://<my-deploy-token-name>:<my-deploy-token-password>@my-gitlab-domain/my-name/my-project-name#v0.0.2
11 silly cache add parsed spec Result {
11 silly cache add   raw: 'git+http://<my-deploy-token-name>:<my-deploy-token-password>@my-gitlab-domain/my-name/my-project-name#v0.0.2',
11 silly cache add   scope: null,
11 silly cache add   escapedName: null,
11 silly cache add   name: null,
11 silly cache add   rawSpec: 'git+http://<my-deploy-token-name>:<my-deploy-token-password>@my-gitlab-domain/my-name/my-project-name#v0.0.2',
11 silly cache add   spec: 'http://<my-deploy-token-name>:<my-deploy-token-password>@my-gitlab-domain/my-name/my-project-name#v0.0.2',
11 silly cache add   type: 'git' }
12 verbose addRemoteGit caching git+http://<my-deploy-token-name>:<my-deploy-token-password>@my-gitlab-domain/my-name/my-project-name#v0.0.2
13 silly tryClone cloning git+http://<my-deploy-token-name>:<my-deploy-token-password>@my-gitlab-domain/my-name/my-project-name#v0.0.2 via git+http://<my-deploy-token-name>:<my-deploy-token-password>@my-gitlab-domain/my-name/my-project-name#v0.0.2
14 verbose tryClone git+http://<my-deploy-token-name>:<my-deploy-token-password>@my-gitlab-domain/my-name/my-project-name#v0.0.2 not in flight; caching
15 verbose correctMkdir /Users/wangzhiyong/.npm/_git-remotes correctMkdir not in flight; initializing
16 info git [ 'config', '--get', 'remote.origin.url' ]
17 warn addRemoteGit Error: Command failed: git config --get remote.origin.url
17 warn addRemoteGit
17 warn addRemoteGit     at ChildProcess.exithandler (child_process.js:199:12)
17 warn addRemoteGit     at emitTwo (events.js:106:13)
17 warn addRemoteGit     at ChildProcess.emit (events.js:191:7)
17 warn addRemoteGit     at maybeClose (internal/child_process.js:920:16)
17 warn addRemoteGit     at Socket.<anonymous> (internal/child_process.js:351:11)
17 warn addRemoteGit     at emitOne (events.js:96:13)
17 warn addRemoteGit     at Socket.emit (events.js:188:7)
17 warn addRemoteGit     at Pipe._handle.close [as _onclose] (net.js:509:12)
17 warn addRemoteGit  git+http://<my-deploy-token-name>:<my-deploy-token-password>@my-gitlab-domain/my-name/my-project-name#v0.0.2 resetting remote /Users/wangzhiyong/.npm/_git-remotes/git+http://<my-deploy-token-name>:<my-deploy-token-password>@my-gitlab-domain/my-name/my-project-name#v0.0.2 because of error: { Error: Command failed: git config --get remote.origin.url
17 warn addRemoteGit
17 warn addRemoteGit     at ChildProcess.exithandler (child_process.js:199:12)
17 warn addRemoteGit     at emitTwo (events.js:106:13)
17 warn addRemoteGit     at ChildProcess.emit (events.js:191:7)
17 warn addRemoteGit     at maybeClose (internal/child_process.js:920:16)
17 warn addRemoteGit     at Socket.<anonymous> (internal/child_process.js:351:11)
17 warn addRemoteGit     at emitOne (events.js:96:13)
17 warn addRemoteGit     at Socket.emit (events.js:188:7)
17 warn addRemoteGit     at Pipe._handle.close [as _onclose] (net.js:509:12)
17 warn addRemoteGit   killed: false,
17 warn addRemoteGit   code: 1,
17 warn addRemoteGit   signal: null,
17 warn addRemoteGit   cmd: 'git config --get remote.origin.url' }
18 info resetRemote resetting /Users/wangzhiyong/.npm/_git-remotes/git+http://<my-deploy-token-name>:<my-deploy-token-password>@my-gitlab-domain/my-name/my-project-name#v0.0.2 for git+http://<my-deploy-token-name>:<my-deploy-token-password>@my-gitlab-domain/my-name/my-project-name#v0.0.2
19 silly gentlyRm /Users/wangzhiyong/.npm/_git-remotes/git+http://<my-deploy-token-name>:<my-deploy-token-password>@my-gitlab-domain/my-name/my-project-name#v0.0.2 is being purged
20 verbose gentlyRm don't care about contents; nuking /Users/wangzhiyong/.npm/_git-remotes/git+http://<my-deploy-token-name>:<my-deploy-token-password>@my-gitlab-domain/my-name/my-project-name#v0.0.2
21 silly vacuum-fs purging /Users/wangzhiyong/.npm/_git-remotes/git+http://<my-deploy-token-name>:<my-deploy-token-password>@my-gitlab-domain/my-name/my-project-name#v0.0.2
22 silly vacuum-fs quitting because other entries in /Users/wangzhiyong/.npm/_git-remotes
23 info git [ 'clone',
23 info git   '--template=/Users/wangzhiyong/.npm/_git-remotes/_templates',
23 info git   '--mirror',
23 info git   'git+http://<my-deploy-token-name>:<my-deploy-token-password>@my-gitlab-domain/my-name/my-project-name#v0.0.2',
23 info git   '/Users/wangzhiyong/.npm/_git-remotes/git+http://<my-deploy-token-name>:<my-deploy-token-password>@my-gitlab-domain/my-name/my-project-name#v0.0.2' ]
24 error git clone --template=/Users/wangzhiyong/.npm/_git-remotes/_templates --mirror git+http://<my-deploy-token-name>:<my-deploy-token-password>@my-gitlab-domain/my-name/my-project-name#v0.0.2 /Users/wangzhiyong/.npm/_git-remotes/git+http://<my-deploy-token-name>:<my-deploy-token-password>@my-gitlab-domain/my-name/my-project-name#v0.0.2: Cloning into bare repository '/Users/wangzhiyong/.npm/_git-remotes/git+http://<my-deploy-token-name>:<my-deploy-token-password>@my-gitlab-domain/my-name/my-project-name#v0.0.2'...
24 error git clone --template=/Users/wangzhiyong/.npm/_git-remotes/_templates --mirror git+http://<my-deploy-token-name>:<my-deploy-token-password>@my-gitlab-domain/my-name/my-project-name#v0.0.2 /Users/wangzhiyong/.npm/_git-remotes/git+http://<my-deploy-token-name>:<my-deploy-token-password>@my-gitlab-domain/my-name/my-project-name#v0.0.2: fatal: unable to find remote helper for 'git+http'
25 silly fetchPackageMetaData Error: Command failed: git clone --template=/Users/wangzhiyong/.npm/_git-remotes/_templates --mirror git+http://<my-deploy-token-name>:<my-deploy-token-password>@my-gitlab-domain/my-name/my-project-name#v0.0.2 /Users/wangzhiyong/.npm/_git-remotes/git+http://<my-deploy-token-name>:<my-deploy-token-password>@my-gitlab-domain/my-name/my-project-name#v0.0.2
25 silly fetchPackageMetaData Cloning into bare repository '/Users/wangzhiyong/.npm/_git-remotes/git+http://<my-deploy-token-name>:<my-deploy-token-password>@my-gitlab-domain/my-name/my-project-name#v0.0.2'...
25 silly fetchPackageMetaData fatal: unable to find remote helper for 'git+http'
25 silly fetchPackageMetaData
25 silly fetchPackageMetaData     at ChildProcess.exithandler (child_process.js:199:12)
25 silly fetchPackageMetaData     at emitTwo (events.js:106:13)
25 silly fetchPackageMetaData     at ChildProcess.emit (events.js:191:7)
25 silly fetchPackageMetaData     at maybeClose (internal/child_process.js:920:16)
25 silly fetchPackageMetaData     at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5)
25 silly fetchPackageMetaData  error for git+http://<my-deploy-token-name>:<my-deploy-token-password>@my-gitlab-domain/my-name/my-project-name#v0.0.2 { Error: Command failed: git clone --template=/Users/wangzhiyong/.npm/_git-remotes/_templates --mirror git+http://<my-deploy-token-name>:<my-deploy-token-password>@my-gitlab-domain/my-name/my-project-name#v0.0.2 /Users/wangzhiyong/.npm/_git-remotes/git+http://<my-deploy-token-name>:<my-deploy-token-password>@my-gitlab-domain/my-name/my-project-name#v0.0.2
25 silly fetchPackageMetaData Cloning into bare repository '/Users/wangzhiyong/.npm/_git-remotes/git+http://<my-deploy-token-name>:<my-deploy-token-password>@my-gitlab-domain/my-name/my-project-name#v0.0.2'...
25 silly fetchPackageMetaData fatal: unable to find remote helper for 'git+http'
25 silly fetchPackageMetaData
25 silly fetchPackageMetaData     at ChildProcess.exithandler (child_process.js:199:12)
25 silly fetchPackageMetaData     at emitTwo (events.js:106:13)
25 silly fetchPackageMetaData     at ChildProcess.emit (events.js:191:7)
25 silly fetchPackageMetaData     at maybeClose (internal/child_process.js:920:16)
25 silly fetchPackageMetaData     at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5)
25 silly fetchPackageMetaData   killed: false,
25 silly fetchPackageMetaData   code: 128,
25 silly fetchPackageMetaData   signal: null,
25 silly fetchPackageMetaData   cmd: 'git clone --template=/Users/wangzhiyong/.npm/_git-remotes/_templates --mirror git+http://<my-deploy-token-name>:<my-deploy-token-password>@my-gitlab-domain/my-name/my-project-name#v0.0.2 /Users/wangzhiyong/.npm/_git-remotes/git+http://<my-deploy-token-name>:<my-deploy-token-password>@my-gitlab-domain/my-name/my-project-name#v0.0.2' }
26 silly rollbackFailedOptional Starting
27 silly rollbackFailedOptional Finishing
28 silly runTopLevelLifecycles Finishing
29 silly install printInstalled
30 verbose stack Error: Command failed: git clone --template=/Users/wangzhiyong/.npm/_git-remotes/_templates --mirror git+http://<my-deploy-token-name>:<my-deploy-token-password>@my-gitlab-domain/my-name/my-project-name#v0.0.2 /Users/wangzhiyong/.npm/_git-remotes/git+http://<my-deploy-token-name>:<my-deploy-token-password>@my-gitlab-domain/my-name/my-project-name#v0.0.2
30 verbose stack Cloning into bare repository '/Users/wangzhiyong/.npm/_git-remotes/git+http://<my-deploy-token-name>:<my-deploy-token-password>@my-gitlab-domain/my-name/my-project-name#v0.0.2'...
30 verbose stack fatal: unable to find remote helper for 'git+http'
30 verbose stack
30 verbose stack     at ChildProcess.exithandler (child_process.js:199:12)
30 verbose stack     at emitTwo (events.js:106:13)
30 verbose stack     at ChildProcess.emit (events.js:191:7)
30 verbose stack     at maybeClose (internal/child_process.js:920:16)
30 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5)
31 verbose cwd /Users/wangzhiyong/Work/my-project/my-project/webpack
32 error Darwin 19.3.0
33 error argv "/Users/wangzhiyong/.nvm/versions/node/v6.17.0/bin/node" "/Users/wangzhiyong/.nvm/versions/node/v6.17.0/bin/npm" "install" "git+http://<my-deploy-token-name>:<my-deploy-token-password>@my-gitlab-domain/my-name/my-project-name#v0.0.2"
34 error node v6.17.0
35 error npm  v3.10.10
36 error code 128
37 error Command failed: git clone --template=/Users/wangzhiyong/.npm/_git-remotes/_templates --mirror git+http://<my-deploy-token-name>:<my-deploy-token-password>@my-gitlab-domain/my-name/my-project-name#v0.0.2 /Users/wangzhiyong/.npm/_git-remotes/git+http://<my-deploy-token-name>:<my-deploy-token-password>@my-gitlab-domain/my-name/my-project-name#v0.0.2
37 error Cloning into bare repository '/Users/wangzhiyong/.npm/_git-remotes/git+http://<my-deploy-token-name>:<my-deploy-token-password>@my-gitlab-domain/my-name/my-project-name#v0.0.2'...
37 error fatal: unable to find remote helper for 'git+http'
38 error If you need help, you may report this error at:
38 error     <https://github.com/npm/npm/issues>
39 verbose exit [ 1, true ]

Или возможно решить эту проблему, но все еще используя NPM версию 3?

1 Ответ

0 голосов
/ 21 февраля 2020

Я нашел способ справиться с этим.

Я могу npm установить последнюю npm

npm install npm@latest --save-dev

и затем добавить скрипт

"scripts": {
  "runInstall": "npm install",
},

И тогда это сработало.

...