【问题标题】:React npm warn deprecates how to deal with it?React npm warn 弃用了如何处理?
【发布时间】:2021-11-05 12:48:13
【问题描述】:
npm WARN deprecated flatten@1.0.3: flatten is deprecated in favor of utility frameworks such as lodash.
npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated querystring@0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated sane@4.1.0: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
npm WARN deprecated @hapi/address@2.1.4: Moved to 'npm install @sideway/address'
npm WARN deprecated rollup-plugin-babel@4.4.0: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-babel.
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
tps://v8.dev/blog/math-random for details.
npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/joi@15.1.1: Switch to 'npm install joi'
npm WARN deprecated core-js@2.6.12: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.

【问题讨论】:

  • 请修剪您的代码,以便更容易找到您的问题。请按照以下指南创建minimal reproducible example。
  • 我遇到了同样的问题并遵循以下答案,但它对我不起作用。有什么解决办法吗?

标签: node.js reactjs npm warnings deprecated


【解决方案1】:

这些警告来自您在 package.json 中使用的库。有两种类型的库:

  1. 直接库:您直接列出它
  2. 传递库:使用其他库安装

那么你必须做什么:

运行npm list --depth=3(如果没有找到则增加深度) 并跟踪库的来源,一旦找到它,您有两个选择:

  1. 升级它,大多数情况下它都可以工作
  2. 删除它并使用另一个具有最新版本的传递库

【讨论】:

    【解决方案2】:

    重新安装您的节点 js 并再次尝试 npm install。 接下来忽略错误并启动 npm ,它显示“错误:错误:0308010C:数字信封例程::不支持”错误。 然后转到 package.json 文件并将 "start": "react-scripts start" 更改为 "start": "react-scripts --openssl-legacy-provider start"

    注意:它会使您的代码在不安全的 ssl 上运行,但不能解决根本问题。

    【讨论】:

    • 嗨@NAYINIYESHWANTHREDDY,请考虑扩大您的答案,似乎无法评估问题
    【解决方案3】:

    试试

    npm i -g

    或

    删除当前版本的节点并重新安装最新的稳定版本。

    其中任何一个都应该有效。

    【讨论】:

      【解决方案4】:

      我遇到了类似的问题。只需使用以下命令更新您的 npm 版本:

      npm install -g npm
      

      【讨论】:

      • 其实我试过了,但是错误还是一样
      猜你喜欢
      • 2017-12-16
      • 2016-11-17
      • 2022-06-15
      • 2023-01-12
      • 1970-01-01
      • 2023-02-08
      • 2022-12-23
      • 2020-12-14
      • 2022-11-20
      相关资源
      最近更新 更多