npm web3给出弃用警告是个问题吗?

0dxa2lsx  于 2022-11-14  发布在  其他
关注(0)|答案(1)|浏览(281)

将web3作为依赖项会发出如下的弃用通知

npm WARN deprecated @types/keyv@4.2.0: This is a stub types definition. keyv provides its own type definitions, so you do not need this installed.
npm WARN deprecated mkdirp-promise@5.0.1: This package is broken and no longer maintained. 'mkdirp' itself supports promises now, please switch to that.
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated multicodec@1.0.4: This module has been superseded by the multiformats module
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.
npm WARN deprecated uuid@3.3.2: 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.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated multibase@0.6.1: This module has been superseded by the multiformats module
npm WARN deprecated multibase@0.7.0: This module has been superseded by the multiformats module
npm WARN deprecated multicodec@0.5.7: This module has been superseded by the multiformats module
npm WARN deprecated cids@0.7.5: This module has been superseded by the multiformats module

这是一个问题吗?如果是,我如何解决它?

9gm1akwq

9gm1akwq1#

该错误可能是由于.json文件中的依赖项版本造成的。
我试着用gatsby建立一个网站。在网站发布一两个月后,我试着用npm update,并向我抛出了一个与你的错误非常相似的错误。

npm WARN deprecated multer@1.4.4: Multer 1.x is affected by CVE-2022-24434. This is fixed in v1.4.4-lts.1 which drops support for versions of Node.js before 6. Please upgrade to at least Node.js 6 and version 1.4.4-lts.1 of Multer. If you need support for older versions of Node.js, we are open to accepting patches that would fix the CVE on the main 1.x release line, whilst maintaining compatibility with Node.js 0.10.
npm WARN deprecated @hapi/address@2.1.4: Moved to 'npm install @sideway/address'
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 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.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 subscriptions-transport-ws@0.9.19: The `subscriptions-transport-ws` package is no longer maintained. We recommend you use `graphql-ws` instead. For help migrating Apollo software to `graphql-ws`, see https://www.apollographql.com/docs/apollo-server/data/subscriptions/#switching-from-subscriptions-transport-ws    For general help using `graphql-ws`, see https://github.com/enisdenjo/graphql-ws/blob/master/README.md
npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm WARN deprecated gatsby-recipes@0.25.0: gatsby-recipes has been removed from gatsby/gatsby-cli >=4.5.0. Update to gatsby@latest/gatsby-cli@latest to use versions without gatsby-recipes. This package will no longer receive updates.

然后我发现npm有一个非常好的方式来显示依赖版本,在.json文件中使用npm outdated来提到这些版本。

$ npm outdated
Package                          Current  Wanted  Latest  Location                                      Depended by
babel-plugin-styled-components    1.13.3  1.13.3   2.0.7  node_modules/babel-plugin-styled-components   portfolio-main
babel-preset-gatsby               1.14.0  1.14.0  2.24.0  node_modules/babel-preset-gatsby              portfolio-main
eslint                            7.32.0  7.32.0  8.26.0  node_modules/eslint                           portfolio-main
gatsby                            3.14.6  3.14.6  4.24.5  node_modules/gatsby                           portfolio-main
gatsby-plugin-google-analytics    3.14.0  3.14.0  4.24.0  node_modules/gatsby-plugin-google-analytics   portfolio-main
gatsby-plugin-image               1.14.2  1.14.2  2.24.0  node_modules/gatsby-plugin-image              portfolio-main
gatsby-plugin-manifest            3.14.0  3.14.0  4.24.0  node_modules/gatsby-plugin-manifest           portfolio-main
gatsby-plugin-netlify             3.14.0  3.14.0   5.0.1  node_modules/gatsby-plugin-netlify            portfolio-main
gatsby-plugin-offline             4.14.0  4.14.0  5.24.0  node_modules/gatsby-plugin-offline            portfolio-main
gatsby-plugin-react-helmet        4.14.0  4.14.0  5.24.0  node_modules/gatsby-plugin-react-helmet       portfolio-main
gatsby-plugin-sharp               3.14.3  3.14.3  4.24.0  node_modules/gatsby-plugin-sharp              portfolio-main
gatsby-plugin-sitemap             4.10.0  4.10.0  5.24.0  node_modules/gatsby-plugin-sitemap            portfolio-main
gatsby-plugin-styled-components   4.14.0  4.14.0  5.24.0  node_modules/gatsby-plugin-styled-components  portfolio-main
gatsby-remark-images              5.11.0  5.11.0  6.24.0  node_modules/gatsby-remark-images             portfolio-main
gatsby-remark-prismjs             5.11.0  5.11.0  6.24.0  node_modules/gatsby-remark-prismjs            portfolio-main
gatsby-source-filesystem          3.14.0  3.14.0  4.24.0  node_modules/gatsby-source-filesystem         portfolio-main
gatsby-transformer-remark         4.11.0  4.11.0  5.24.0  node_modules/gatsby-transformer-remark        portfolio-main
gatsby-transformer-sharp          3.14.0  3.14.0  4.24.0  node_modules/gatsby-transformer-sharp         portfolio-main
husky                              6.0.0   6.0.0   8.0.1  node_modules/husky                            portfolio-main
lint-staged                       10.5.4  10.5.4  13.0.3  node_modules/lint-staged                      portfolio-main
react                             17.0.2  17.0.2  18.2.0  node_modules/react                            portfolio-main
react-dom                         17.0.2  17.0.2  18.2.0  node_modules/react-dom                        portfolio-main

在我尝试使用^之前,我把所有的依赖项一个一个地编辑到想要的版本。然后npm update成功地完成了这个任务,没有任何错误。我的gatsby build工作得很好。
我建议不要担心你的代码,如果问题和我的类似,只是依赖项一直在更新,我们需要记录版本,或者如果你想自动更新,就使用^~
您可以在npmwebsite上查看更多详细信息。

相关问题