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

[BUG] unknown git error occurred, when install lots of git dep at same time #6578

Open
2 tasks done
Dolors opened this issue Jun 21, 2023 · 0 comments
Open
2 tasks done
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 9.x work is associated with a specific npm 9 release

Comments

@Dolors
Copy link

Dolors commented Jun 21, 2023

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

I have a complex npm v6 large project, and I have resolved many git+https protocol dependencies issue (refs #2784) in the process of preparing for migration.

This project used more than 160 git+https protocol dependencies.

After careful testing, it was found that:

When npm install more than 60 git+https protocol dependencies at the same time.
Will likely receive the following errors (from log):

447 verbose stack Error: An unknown git error occurred
447 verbose stack     at makeError (C:\swdtools\node-v20.3.0-win-x64\node_modules\npm\node_modules\@npmcli\git\lib\make-error.js:28:13)
447 verbose stack     at C:\swdtools\node-v20.3.0-win-x64\node_modules\npm\node_modules\@npmcli\git\lib\spawn.js:37:26
447 verbose stack     at async C:\swdtools\node-v20.3.0-win-x64\node_modules\npm\node_modules\pacote\lib\git.js:268:19
447 verbose stack     at async withTempDir (C:\swdtools\node-v20.3.0-win-x64\node_modules\npm\node_modules\@npmcli\fs\lib\with-temp-dir.js:21:14)
447 verbose stack     at async Promise.all (index 14)
447 verbose stack     at async #buildDepStep (C:\swdtools\node-v20.3.0-win-x64\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:1034:5)
447 verbose stack     at async Arborist.buildIdealTree (C:\swdtools\node-v20.3.0-win-x64\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:196:7)
447 verbose stack     at async Promise.all (index 1)
447 verbose stack     at async Arborist.reify (C:\swdtools\node-v20.3.0-win-x64\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\reify.js:159:5)
447 verbose stack     at async Install.exec (C:\swdtools\node-v20.3.0-win-x64\node_modules\npm\lib\commands\install.js:147:5)
448 verbose cwd C:\Users\██████\Desktop\test
449 verbose Windows_NT 10.0.19044
450 verbose node v20.3.0
451 verbose npm  v9.6.7
452 error code 128
453 error An unknown git error occurred
454 error command git --no-replace-objects clone -b feature/npm9 https://alm-github.systems.██████/██████/██████ C:\Users\██████\npm\npm-cache\_cacache\tmp\git-clonesaLTsm --recurse-submodules --config core.longpaths=true
455 error Cloning into 'C:\Users\██████\npm\npm-cache\_cacache\tmp\git-clonesaLTsm'...
455 error remote: Invalid username or password.
455 error fatal: Authentication failed for 'https://alm-github.systems.██████/██████/██████/'
456 verbose exit 128
457 timing npm Completed in 712429ms
458 verbose unfinished npm timer reify 1687255862724
459 verbose unfinished npm timer reify:loadTrees 1687255862728
460 verbose code 128
461 error A complete log of this run can be found in: C:\Users\██████\npm\npm-cache\_logs\2023-06-20T10_11_02_245Z-debug-0.log

Or following errors (from console):

npm WARN cleanup Failed to remove some directories [
npm WARN cleanup   [
npm WARN cleanup     'C:\\Users\\██████\\Desktop\\test\\node_modules',
npm WARN cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\Users\██████\Desktop\test\node_modules\@babel\runtime\helpers'] {
npm WARN cleanup       errno: -4048,
npm WARN cleanup       code: 'EPERM',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'C:\\Users\\██████\\Desktop\\test\\node_modules\\@babel\\runtime\\helpers'
npm WARN cleanup     }
npm WARN cleanup   ],
npm WARN cleanup   [
npm WARN cleanup     'C:\\Users\\██████\\Desktop\\test\\node_modules\\recompose',
npm WARN cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\Users\██████\Desktop\test\node_modules\recompose'] {
npm WARN cleanup       errno: -4048,
npm WARN cleanup       code: 'EPERM',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'C:\\Users\\██████\\Desktop\\test\\node_modules\\recompose'
npm WARN cleanup     }
npm WARN cleanup   ],
npm WARN cleanup   [
npm WARN cleanup     'C:\\Users\\██████\\Desktop\\test\\node_modules\\@jridgewell',
npm WARN cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\Users\██████\Desktop\test\node_modules\@jridgewell\trace-mapping\node_modules\@jridgewell\sourcemap-codec\dist\types'] {
npm WARN cleanup       errno: -4048,
npm WARN cleanup       code: 'EPERM',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'C:\\Users\\██████\\Desktop\\test\\node_modules\\@jridgewell\\trace-mapping\\node_modules\\@jridgewell\\sourcemap-codec\\dist\\types'
npm WARN cleanup     }
npm WARN cleanup   ],
npm WARN cleanup   [
npm WARN cleanup     'C:\\Users\\██████\\Desktop\\test\\node_modules\\react-beautiful-dnd',
npm WARN cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\Users\██████\Desktop\test\node_modules\react-beautiful-dnd\src\view'] {
npm WARN cleanup       errno: -4048,
npm WARN cleanup       code: 'EPERM',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'C:\\Users\\██████\\Desktop\\test\\node_modules\\react-beautiful-dnd\\src\\view'
npm WARN cleanup     }
npm WARN cleanup   ]
npm WARN cleanup ]
npm ERR! code 128
npm ERR! git dep preparation failed
npm ERR! command C:\swdtools\node-v20.3.0-win-x64\node.exe C:\swdtools\node-v20.3.0-win-x64\node_modules\npm\bin\npm-cli.js install --force --cache=C:\Users\██████\npm\npm-cache --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit --include=dev --include=peer --include=optional --no-package-lock-only --no-dry-run
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm ERR! code 128
npm ERR! npm ERR! An unknown git error occurred
npm ERR! npm ERR! command git --no-replace-objects ls-remote https://alm-github.systems.██████/██████/██████
npm ERR! npm ERR! remote: Invalid username or password.
npm ERR! npm ERR! fatal: Authentication failed for 'https://alm-github.systems.██████/██████/██████/'
npm ERR!
npm ERR! npm ERR! A complete log of this run can be found in: C:\Users\██████\npm\npm-cache\_logs\2023-06-21T02_01_24_039Z-debug-0.log

npm ERR! A complete log of this run can be found in: C:\Users\██████\npm\npm-cache\_logs\2023-06-21T01_54_13_365Z-debug-0.log

Or following errors (from log):

232 verbose stack Error: An unknown git error occurred
232 verbose stack     at makeError (C:\swdtools\node-v20.3.0-win-x64\node_modules\npm\node_modules\@npmcli\git\lib\make-error.js:28:13)
232 verbose stack     at C:\swdtools\node-v20.3.0-win-x64\node_modules\npm\node_modules\@npmcli\git\lib\spawn.js:37:26
233 verbose cwd C:\Users\██████\Desktop\test
234 verbose Windows_NT 10.0.19044
235 verbose node v20.3.0
236 verbose npm  v9.6.7
237 error code 128
238 error An unknown git error occurred
239 error command git --no-replace-objects ls-remote https://alm-github.systems.██████/██████/██████.git
240 error remote: Invalid username or password.
240 error fatal: Authentication failed for 'https://alm-github.systems.██████/██████/██████.git/'
241 verbose exit 128
242 timing npm Completed in 159154ms
243 verbose unfinished npm timer reify 1687315663691
244 verbose unfinished npm timer reify:loadTrees 1687315663697
245 verbose code 128
246 error A complete log of this run can be found in: C:\Users\██████\npm\npm-cache\_logs\2023-06-21T02_47_43_096Z-debug-0.log

When npm install less than 60 git+https protocol dependencies at the same time.
Will install successfully.

The dependencies cause these errors, or the list of dependencies installed when successful, did not find any pattern.
The error occurred git dep, which may be any one.

Note: https://alm-github.systems.██████/ is a Github Enterprise

Expected Behavior

As npm v6, can ben installed successfully.

Steps To Reproduce

  1. In this environment...
  2. With this config...
  3. Run npm install
  4. See error...

Environment

  • npm: 9.6.7
  • Node.js: v20.3.0
  • OS Name: Windows 10 Enterprise
  • System Model Name: ThinkPad T14
  • npm config:
; "user" config from C:\Users\██████\.npmrc

//digitalnexus01.systems.██████:8081/nexus/repository/npm-group/:_auth = (protected)
//nexus3.systems.██████:8081/nexus/repository/raw-tpvr-misc-n3p/:_auth = (protected)
//nexus301.systems.██████:8081/nexus/repository/npm-group/:_auth = (protected)
//nexus303.systems.██████:8081/nexus/repository/npm-group/:_auth = (protected)
cache = "C:\\Users\\██████\\npm\\npm-cache"
prefix = "C:\\Users\\██████\\npm"
python = "C:\\Program Files (x86)\\Python35-32\\python.exe"
; registry = "https://nexus303.systems.██████:8081/nexus/repository/npm-group/" ; overridden by project
; script-shell = "bash" ; overridden by project
scripts-prepend-node-path = true
strict-ssl = false

; "project" config from C:\Users\██████\Desktop\test\.npmrc

legacy-peer-deps = true
registry = "https://nexus303.systems.██████:8081/nexus/repository/npm-group/"
script-shell = "bash"

; node bin location = C:\swdtools\node-v20.3.0-win-x64\node.exe
; node version = v20.3.0
; npm local prefix = C:\Users\██████\Desktop\test
; npm version = 9.6.7
; cwd = C:\Users\██████\Desktop\test
; HOME = C:\Users\██████
; Run `npm config ls -l` to show all defaults.
@Dolors Dolors added Bug thing that needs fixing Needs Triage needs review for next steps Release 9.x work is associated with a specific npm 9 release labels Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 9.x work is associated with a specific npm 9 release
Projects
None yet
Development

No branches or pull requests

1 participant