Javascript 如何将 lodash 更新到最新版本

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/34035682/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-23 15:49:55  来源:igfitidea点击:

How to update lodash to the latest version

javascriptnode.jsnpmlodashjpm

提问by OshoParth

I am using npm on the debian Linux flavor to install Jpm. But am getting errors about the versions of lodash installed (as follows)

我在 debian Linux 版本上使用 npm 来安装 Jpm。但是我收到关于安装的 lodash 版本的错误(如下)

test@localhost:~# npm install jpm --global
npm WARN deprecated [email protected]: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^3.0.0.

I have referred to few of the following links but am still unable to update the versions but still the issue persists.

我已经提到了以下几个链接,但仍然无法更新版本,但问题仍然存在。

https://github.com/lodash/lodash/tree/3.10.1-npm

https://github.com/lodash/lodash/tree/3.10.1-npm

https://github.com/npm/npm/issues/10573

https://github.com/npm/npm/issues/10573

Kindly suggest a solution to update the lodash version.

请提出更新 lodash 版本的解决方案。

采纳答案by Matt Way

After re-reading the question, I realised that the error is not in fact an error at all. What you are getting is a warning, saying that jpmuses [email protected], which is deprecated, and no longer maintained.

重新阅读问题后,我意识到错误实际上根本不是错误。你得到的是一个警告,说jpm使用 [email protected],它已被弃用,不再维护。

After looking at the latest version of jpm, I noticed that the lodash dependency is for version 3.3.1which should be fine.

在查看了 的最新版本后jpm,我注意到 lodash 依赖项适用于3.3.1应该没问题的版本。

This makes me think that either the jpm version that is being installed is old, or a jpm dependency relies on an older version of lodash, which would need to be updated to remove the warning.

这让我认为正在安装的 jpm 版本是旧的,或者 jpm 依赖项依赖于旧版本的 lodash,需要更新以删除警告。

Either way, this warning can be ignored, but if you must get rid of it, you will need to rebuild jpm (or possibly a jpm dependency and jpm), after updating the deprecated lodash reference.

无论哪种方式,都可以忽略此警告,但如果您必须摆脱它,则需要在更新已弃用的 lodash 引用后重建 jpm(或可能是 jpm 依赖项和 jpm)。

回答by Vaggelis Stefanakis

For me , using Windows 7 worked the following:

对我来说,使用 Windows 7 工作如下:

     npm i --save lodash

Documentation on lodash can be found here:

可以在此处找到有关 lodash 的文档:

https://lodash.com/

https://lodash.com/