【问题标题】:Error during installing dependencies in Gitlab pipeline在 Gitlab 管道中安装依赖项时出错
【发布时间】:2021-12-08 04:05:34
【问题描述】:

在 gitlab 管道中安装依赖项时出错。我不知道我能用这个错误做什么。有人可以解释为什么会出现吗?

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mozjpeg@7.1.1 postinstall: `node lib/install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the mozjpeg@7.1.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-10-21T11_15_27_617Z-debug.log

【问题讨论】:

    标签: node.js npm gitlab gitlab-ci gitlab-pipelines


    【解决方案1】:

    如果您不将 node_modulespackage-lock.json 推送到您的存储库

    这可能是这个版本中众所周知的问题

    https://github.com/imagemin/mozjpeg-bin/issues/68

    我建议你使用旧版本 "mozjpeg": "7.1.0",你需要在 package.json 中更改它

    如果您将 node_modulespackage-lock.json 推送到您的存储库

    您可以尝试在安装 npm 之前将其添加到管道中

    rm -rf node_modules package-lock.json
    

    【讨论】:

    • 我刚刚将 package-lock.json 恢复到以前的版本,现在我正在等待我的管道,希望它有所帮助
    • 所以我应该为我的旧项目使用类似 docker 的东西?
    • @DawidSzemborowski 好的 ;)
    • 我刚刚在我的 .gitlab-ci.yml 中将节点版本从 12 更新到 16 并且它可以工作
    • @DawidSzemborowski 好,很高兴听到这个消息;)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-11-18
    • 1970-01-01
    • 2021-05-25
    • 1970-01-01
    相关资源
    最近更新 更多