【问题标题】:found 40 vulnerabilities (7 low, 31 moderate, 1 high, 1 critical)发现 40 个漏洞(7 个低、31 个中等、1 个高、1 个严重)
【发布时间】:2018-12-04 00:19:13
【问题描述】:

我在运行 npm uninstall 时遇到以下错误...谁能帮忙解决...我已经做了几乎所有的事情来解决这个问题...

npm WARN react-star-rating-component@1.4.1 requires a peer of react@^16.2.0 but none is installed. You must install peer dependencies yourself.
npm WARN The package detect-port is included as both a dev and production dependency.

audited 17423 packages in 20.551s
found 40 vulnerabilities (7 low, 31 moderate, 1 high, 1 critical)
  run `npm audit fix` to fix them, or `npm audit` for details

当我运行 npm audit 时,它给了我以下 = 错误

npm ERR! code ELOCKVERIFY
npm ERR! Errors were found in your package-lock.json, run  npm install  to fix them.
npm ERR!     Invalid: lock file's detect-port@1.2.3 does not satisfy detect-port@1.0.1

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2018-06-25T12_13_53_712Z-debug.log

【问题讨论】:

  • 执行 npm audit 将显示详细信息(如输出中所述)并提供更新相应库的命令。
  • @Sirko 感谢您的回复...请检查更新的问题
  • 错误说明了问题(至少一个):您安装的detect-port 版本与package.json 中要求的版本不匹配。我会开始解决这个问题。
  • @Sirko 谢谢,但是如何解决这个错误。你是它的主要开发者吗...
  • 看看你的 JSON 包。在dependencies 下将有一个detect-port 条目。版本号的语法解释为here。确保版本 1.2.3 与那里请求的版本兼容。

标签: reactjs npm npm-install node-modules npm-start


【解决方案1】:

尝试从 package.json 文件中的 Dependencies 和 devDependencies 中删除检测端口依赖项,并将其从 node_modules 中删除,并添加带有版本的检测端口,然后运行 ​​npm install 和 npm audit fix。这解决了我的问题,但不是这个包。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-08-06
    • 1970-01-01
    • 2020-11-22
    • 2022-08-03
    • 2021-09-05
    • 1970-01-01
    • 1970-01-01
    • 2021-08-10
    相关资源
    最近更新 更多