最近在搞Jenkins+nodejs,前端自动化部署时发现的问题,使用在Jenkins上使用nodejs插件,执行shell脚本实现自动化打包过程时,执行npm install出现以下报错,Windows本地执行没有问题:
npm ERR! code 1 npm ERR! path /root/.jenkins/workspace/test/node_modules/deasync npm ERR! command failed npm ERR! command sh -c node ./build.js npm ERR! `linux-x64-node-15` exists; testing npm ERR! Problem with the binary; manual build incoming npm ERR! stdout= npm ERR! err=Error: Command failed: /root/.jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/node/bin/node quick-test.js npm ERR! /root/.jenkins/workspace/test/node_modules/bindings/bindings.js:135 npm ERR! throw err; npm ERR! ^ npm ERR! npm ERR! Error: Could not locate the bindings file. Tried:
原因:nodejs版本过高的兼容性问题
(题外话:按理说高版本向下兼容,不应该出现这个问题)