【问题标题】:npm install errors out preinstall scriptnpm install 错误输出预安装脚本
【发布时间】:2020-07-15 10:41:42
【问题描述】:

我需要修复 knexnest > knex > minimist 的安全漏洞。 minimist 的版本没有使用 npm audit fix 或简单的 npm update 进行更新。我关注了this article,它更新了版本并给出了 0 的漏洞分数。但是现在当我创建一个 docker 映像(构建)我的 repo 时,它在预安装脚本中失败了。

npx: installed 5 in 5.29s
EACCES: permission denied, open './package-lock.json'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-service@1.2.3 preinstall: `npx npm-force-resolutions`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the my-service@1.2.3 preinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/node/.npm/_logs/2020-07-15T09_56_56_625Z-debug.log

在编辑器上本地安装模块时,不会弹出错误。请帮忙!

【问题讨论】:

    标签: javascript npm npx


    【解决方案1】:

    我遇到了同样的错误,我修复了它

    chomd 666 package-lock.json
    

    这似乎不是根本原因解决方案,但它是一种简单的解决方法。

    【讨论】:

      猜你喜欢
      • 2015-02-21
      • 1970-01-01
      • 2018-03-15
      • 2015-08-21
      • 1970-01-01
      • 2013-07-02
      • 1970-01-01
      • 2017-02-10
      • 1970-01-01
      相关资源
      最近更新 更多