React npm warn deprecated 如何处理?

问题描述 投票:0回答:5
npm WARN deprecated [email protected]: flatten is deprecated in favor of utility frameworks such as lodash.
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated [email protected]: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated [email protected]: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
npm WARN deprecated @hapi/[email protected]: Moved to 'npm install @sideway/address'
npm WARN deprecated [email protected]: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-babel.
npm WARN deprecated [email protected]: 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/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: Switch to 'npm install joi'
npm WARN deprecated [email protected]: 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.
node.js reactjs npm warnings deprecated
5个回答
10
投票

我也有类似的问题。只需使用以下命令来更新您的 npm 版本:

npm install -g npm

4
投票

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

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

那么你必须做什么:

运行

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

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

1
投票
  1. 奔跑

    npm ls package_name@version
    所以在你的情况下第一个包裹

    npm ls [email protected]

  2. 您将获得其安装源。像这样的东西(例如)

     │ │   └─┬ [email protected]
     │ │     └─┬ [email protected]
     │ │       └─┬ [email protected]
     │ │         └── [email protected]
    
  3. 所以,如果是直接安装,您可以简单地从https://www.npmjs.com找到更新的版本。直接在package.json中更新版本,删除node_modules文件夹,然后运行

    npm i

  4. 如果不是直接安装,可以尝试用类似的方式更新父包,看看是否包含所需包的更新版本。更新 package.json 中的父包版本后,如果它包含过时包的更新版本,您将不会在终端中收到错误消息。

这将解决错误消息。


0
投票

我也找不到答案,你能解决这个错误吗?

尝试过 >npm ls typescript@* vu[电子邮件受保护] D:\Desktop\Vue 项目 ue-anime-db └──(空


-4
投票

尝试

npm 我-g

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

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

© www.soinside.com 2019 - 2024. All rights reserved.