Ajaxy / telegram-tt

Telegram Web A, GPL v3
https://web.telegram.org/a
GNU General Public License v3.0
2.21k stars 464 forks source link

Fails npm ci/install with cache #260

Open ergoz opened 1 year ago

ergoz commented 1 year ago

I tries to use npm ci with cache to speedup builds, but it fails. I have some other projects and they works ok with --cache flag, but how to fix it here?

Steps to reproduce:

  1. Clone this repo
  2. Run npm ci --cache .npm --prefer-offline

And i get error:

⇏ npm ci --cache .npm --prefer-offline --ignore-scripts
npm WARN skipping integrity check for git dependency ssh://git@github.com/korenskoy/eslint-plugin-teactn.git
npm WARN skipping integrity check for git dependency ssh://git@github.com/korenskoy/emoji-data-ios.git
npm ERR! code 1
npm ERR! path C:\Users\ergoz\telegram-tt\.npm\_cacache\tmp\git-cloneSNIE0L
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c husky install
npm ERR! .git can't be found (see https://git.io/Jc3F9)

npm ERR! A complete log of this run can be found in: C:\Users\ergoz\telegram-tt\.npm\_logs\2023-06-14T16_43_34_724Z-debug-0.log

In log file i have this error:

4416 http fetch GET 200 https://codeload.github.com/korenskoy/emoji-data-ios/tar.gz/2886b318eae174527c4bc9fcd321940ef3a85527 102451ms (cache miss)
4417 timing arborist:ctor Completed in 0ms
4418 timing reifyNode:node_modules/emoji-data-ios Completed in 146366ms
4419 timing reify:rollback:createSparse Completed in 5815ms
4420 timing reify:rollback:retireShallow Completed in 0ms
4421 timing command:ci Completed in 152903ms
4422 verbose stack Error: command failed
4422 verbose stack     at ChildProcess.<anonymous> (C:\Users\ergoz\scoop\persist\nodejs-lts\bin\node_modules\npm\node_modules\@npmcli\promise-spawn\lib\index.js:53:27)
4422 verbose stack     at ChildProcess.emit (node:events:513:28)
4422 verbose stack     at maybeClose (node:internal/child_process:1091:16)
4422 verbose stack     at ChildProcess._handle.onexit (node:internal/child_process:302:5)
4423 verbose pkgid eslint-plugin-teactn@0.1.0-development
4424 verbose cwd C:\Users\ergoz\telegram-tt
4425 verbose Windows_NT 10.0.22621
4426 verbose node v18.16.0
4427 verbose npm  v9.7.1
4428 error code 1
4429 error path C:\Users\ergoz\telegram-tt\.npm\_cacache\tmp\git-cloneSNIE0L
4430 error command failed
4431 error command C:\WINDOWS\system32\cmd.exe /d /s /c husky install
4432 error .git can't be found (see https://git.io/Jc3F9)
4433 verbose exit 1
4434 timing npm Completed in 153281ms
4435 verbose unfinished npm timer reify 1686761015567
4436 verbose unfinished npm timer reify:unpack 1686761015754
4437 verbose unfinished npm timer reifyNode:node_modules/eslint-plugin-teactn 1686761015814
4438 verbose code 1

BUT: Without --cache flag everything works ok:

⇏ npm ci --prefer-offline            

npm WARN skipping integrity check for git dependency ssh://git@github.com/korenskoy/eslint-plugin-teactn.git
npm WARN skipping integrity check for git dependency ssh://git@github.com/korenskoy/emoji-data-ios.git
npm WARN deprecated electron-osx-sign@0.6.0: Please use @electron/osx-sign moving forward. Be aware the API is slightly different
npm WARN deprecated electron-notarize@1.2.2: Please use @electron/notarize moving forward.  There is no API change, just a package name change
npm WARN deprecated asar@3.2.0: Please use @electron/asar moving forward.  There is no API change, just a package name change
npm WARN deprecated @types/webpack-dev-server@4.7.2: This is a stub types definition. webpack-dev-server provides its own type definitions, so you do not need this installed.
npm WARN deprecated @npmcli/move-file@2.0.1: This functionality has been moved to @npmcli/fs

> telegram-t@1.61.22 postinstall
> (cd dev/eslint-multitab && npm i)

added 56 packages in 7s

95 packages are looking for funding
  run `npm fund` for details

> telegram-t@1.61.22 prepare
> husky install

husky - Git hooks installed

added 1922 packages in 2m

253 packages are looking for funding
  run `npm fund` for details