NodeJS 运行npn安装时获取节点错误

qrjkbowd  于 2023-10-17  发布在  Node.js
关注(0)|答案(2)|浏览(192)

当我尝试在我的tekton管道上运行node install时,我得到下面的错误。我的node版本是16。

npm ERR! 
code EPIPE npm ERR! 
syscall write npm ERR!
errno -32 npm ERR! 
write EPIPE

我确认,我没有任何网络连接问题。我的Nexus存储库可访问(无防火墙规则)。我不明白为什么会有这个问题。我看到400

npm http fetch POST 400 https://www.nexus.mycon.com/repository/npmjs-group/-/npm/v1/security/advisories/bulk 476ms
npm http fetch POST 400 https://www.nexus.mycon.com/repository/npmjs-group/-/npm/v1/security/audits/quick 81ms
npm verb audit error HttpErrorGeneral: 400 Bad Request - POST https://www.nexus.mycon.com/repository/npmjs-group/-/npm/v1/security/audits/quick
npm verb audit error     at /usr/node-v16.19.1-linux-x64/lib/node_modules/npm/node_modules/npm-registry-fetch/lib/check-response.js:95:15
npm verb audit error     at runMicrotasks (<anonymous>)
npm verb audit error     at processTicksAndRejections (node:internal/process/task_queues:96:5)
npm verb audit error     at async Map.[getReport] (/usr/node-v16.19.1-linux-x64/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/audit-report.js:335:21)
npm verb audit error     at async Map.run (/usr/node-v16.19.1-linux-x64/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/audit-report.js:106:19)
npm verb audit error  HttpErrorGeneral: 400 Bad Request - POST https://www.nexus.mycon.com/repository/npmjs-group/-/npm/v1/security/audits/quick
npm verb audit error     at /usr/node-v16.19.1-linux-x64/lib/node_modules/npm/node_modules/npm-registry-fetch/lib/check-response.js:95:15
npm verb audit error     at runMicrotasks (<anonymous>)
npm verb audit error     at processTicksAndRejections (node:internal/process/task_queues:96:5)
npm verb audit error     at async Map.[getReport] (/usr/node-v16.19.1-linux-x64/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/audit-report.js:335:21)
npm verb audit error     at async Map.run (/usr/node-v16.19.1-linux-x64/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/audit-report.js:106:19) {
npm verb audit error   headers: [Object: null prototype] {
npm verb audit error     date: [ 'Wed, 13 Sep 2023 14:26:55 GMT' ],
npm verb audit error     'strict-transport-security': [ 'max-age=7776000' ],
npm verb audit error     'set-cookie': [
npm verb audit error       'dtCookie=v_4_srv_35_sn_CF01212BBD7112C8B91D344E2BE065CC_perc_100000_ol_0_mul_1_app-3A14d8122d44bc9f23_1; Path=/; Domain=.mycon.com'
npm verb audit error     ],
npm verb audit error     'server-timing': [ 'dtRpid;desc="-1194900750", dtSInfo;desc="0"' ],
npm verb audit error     'x-oneagent-js-injection': [ 'true' ],
npm verb audit error     server: [ 'Nexus/3.38.1-01 (PRO)' ],
npm verb audit error     'x-content-type-options': [ 'nosniff' ],
npm verb audit error     'content-security-policy': [
npm verb audit error       'sandbox allow-forms allow-modals allow-popups allow-presentation allow-scripts allow-top-navigation'
npm verb audit error     ],
npm verb audit error     'x-xss-protection': [ '1; mode=block' ],
npm verb audit error     'content-type': [ 'application/json' ],
npm verb audit error     'content-length': [ '228' ],
npm verb audit error     'x-fetch-attempts': [ '1' ]
npm verb audit error   },
npm verb audit error   statusCode: 400,
npm verb audit error   code: 'E400',
npm verb audit error   method: 'POST',
npm verb audit error   uri: 'https://www.nexus.mycon.com/repository/npmjs-group/-/npm/v1/security/audits/quick',
npm verb audit error   body: <Buffer 0a 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d ... 178 more bytes>,
npm verb audit error   pkgid: 'quick'
npm verb audit error }
npm timing auditReport:getReport Completed in 879ms
npm timing reify:audit Completed in 880ms
npm verb stack Error: write EPIPE
npm verb stack     at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:94:16)
npm verb cwd /workspace/source
npm verb Linux 4.18.0-372.64.1.el8_6.x86_64
npm verb node v16.19.1
npm verb npm  v8.19.3
npm ERR! code EPIPE
npm ERR! syscall write
npm ERR! errno -32
npm ERR! write EPIPE
npm verb exit -32
xeufq47z

xeufq47z1#

我以前遇到过类似的错误,对其他人有效的解决方案是从他们的系统中完全卸载npm和Node.js,包括删除任何与它们相关的环境变量
之后,他们重新安装了 npm和Node.js 来解决这个问题。

r3i60tvu

r3i60tvu2#

该问题是因为在node 16映像中启用了审核。我们使用--no-audit关闭了审计,暂时解决了这个问题。

相关问题