在jenkins中运行npm install的时候,有以下错误信息:

+ npm install
internal/modules/cjs/loader.js:605
    throw err;
    ^

Error: Cannot find module '../lib/utils/unsupported.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:603:15)
    at Function.Module._load (internal/modules/cjs/loader.js:529:25)
    at Module.require (internal/modules/cjs/loader.js:659:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at /usr/local/node-v11.4.0-linux-x64/bin/npm:19:21
    at Object.<anonymous> (/usr/local/node-v11.4.0-linux-x64/bin/npm:153:3)
    at Module._compile (internal/modules/cjs/loader.js:723:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:734:10)
    at Module.load (internal/modules/cjs/loader.js:620:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
Build step 'Execute shell' marked build as failure

由于我是从其它服务器拷贝的node文件夹,经过度娘提示,重新下载tag包文件再解压,问题解决,步骤同安装npm一样

# cd /usr/local
# wget https://npm.taobao.org/mirrors/node/latest-v11.x/node-v11.4.0-linux-x64.tar.gz
#tar zxf node-v11.4.0-linux-x64.tar.gz
# ln -s /home/homework/node-v11.4.0-linux-x64/bin/* /usr/bin/
Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐