我的
yarn install --frozen-lockfile --verbose
似乎被挂在了本机模块/gyp构建阶段,我不明白为什么。
在运行
export npm_config_loglevel=verbose
之前我已经尝试过 yarn install
并且没有获得任何更多输出。 这是它悬挂的地方(8 小时以上):
gyp verb download contents checksum {"node-v20.16.0-headers.tar.gz":"6cc5690a67b9b1e1fa8cedaeca41f1bdb5e1af1f7948761c798d33d99f789a5c"}
gyp verb validating download checksum for node-v20.16.0-headers.tar.gz (6cc5690a67b9b1e1fa8cedaeca41f1bdb5e1af1f7948761c798d33d99f789a5c == 6cc5690a67b9b1e1fa8cedaeca41f1bdb5e1af1f7948761c798d33d99f789a5c)
gyp verb get node dir target node version installed: 20.16.0
gyp verb build dir attempting to create "build" dir: /app/server/node_modules/dtrace-provider/build
gyp verb build dir "build" dir needed to be created? Yes
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: /app/server/node_modules/dtrace-provider/build/config.gypi
gyp verb config.gypi checking for gypi file: /app/server/node_modules/dtrace-provider/config.gypi
gyp verb common.gypi checking for gypi file: /app/server/node_modules/dtrace-provider/common.gypi
gyp verb gyp gyp format was not specified; forcing "make"
gyp info spawn /usr/bin/python3
gyp info spawn args [
gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/app/server/node_modules/dtrace-provider/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/root/.cache/node-gyp/20.16.0/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/root/.cache/node-gyp/20.16.0',
gyp info spawn args '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/root/.cache/node-gyp/20.16.0/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/app/server/node_modules/dtrace-provider',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
gyp verb build type Release
gyp verb architecture arm64
gyp verb node dev dir /root/.cache/node-gyp/20.16.0
gyp verb python /usr/bin/python3
gyp verb `which` succeeded for `make` /usr/bin/make
gyp verb bin symlinks created symlink to "/usr/bin/python3" in "/app/server/node_modules/dtrace-provider/build/node_gyp_bins" and added to PATH
gyp info spawn make
gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/app/server/node_modules/dtrace-provider/build'
touch Release/obj.target/DTraceProviderStub.stamp
make: Leaving directory '/app/server/node_modules/dtrace-provider/build'
gyp info ok
它在 Docker 容器内运行。 首先是主机信息:
node:20.16.0-bullseye-slim
来自容器内部的环境信息:
# arch
aarch64
# yarn --version
1.22.22
# node --version
v20.16.0
我已将范围缩小到
[email protected]
。如果不在 package.json
中,它将不会挂起。 此外,它不会在本地 (macOS) 上挂起 [email protected]
。 只挂在我的 CI 环境中(上面的信息)。
出于某种未知的原因,我有一个 git 提交,几天前在 CI 中有效,但现在不再有效(它包含
[email protected]
)。
我已确认
PUPPETEER_SKIP_CHROME_DOWNLOAD=true
设置在 yarn install
之前。
如何获得更多输出,以便确定它挂起的原因?
安装 npm 包时遇到与 21.x.x 相同的问题
highcharts-export-server
。在本地安装得很好,但在构建 docker 镜像时&在 CI 中它会挂起。不幸的是,不知道如何从纱线的该部分获取更多信息来确定发生了什么,但发现这可以作为解决方法:RUN if timeout 35 yarn install; then echo $?; else yarn install; fi
。我们的 highcharts 实例可以使用此功能,不确定它是否完全正常,或者 puppeteer 的某些部分是否无法工作,但似乎是一个功能性的权宜之计。