- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我们想将 lodash 版本更新到 4.17.11,但它是 grunt-angular-translate 的依赖项。 grunt-angular-translate 在 package.json 中。如果我将 grunt-angular-translate 更新到 0.3.0,它不会将 lodash 更新到版本 4.7.11。我们如何更新 package-lock.json 中的依赖项。
package.json:
"devDependencies": {
"grunt": "^1.0.3",
"grunt-angular-translate": "^1.0.0",
"grunt-bump": "^0.8.0",
包锁.json:
"grunt-angular-translate": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/grunt-angular-translate/-/grunt-angular-translate-0.3.0.tgz",
"integrity": "sha1-vQEYr6JNj1cCMf2NUtgp2AjFEbM=",
"dev": true,
"requires": {
"flat": "^1.2.0",
"json-stable-stringify": "^1.0.0",
"lodash": "~2.4.1"
},
"dependencies": {
"lodash": {
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.2.tgz",
"integrity": "sha1-+t2DS5aDBz2hebPq5tnA0VBT9z4=",
"dev": true
}
}
},
最佳答案
根据 npm docs :
package-lock.json is automatically generated for any operations where npm modifies either the node_modules tree, or package.json. It describes the exact tree that was generated, such that subsequent installs are able to generate identical trees, regardless of intermediate dependency updates.
This file is intended to be committed into source repositories, and serves various purposes:
Describe a single representation of a dependency tree such that teammates, deployments, and continuous integration are guaranteed to install exactly the same dependencies.
Provide a facility for users to “time-travel” to previous states of node_modules without having to commit the directory itself.
To facilitate greater visibility of tree changes through readable source control diffs.
And optimize the installation process by allowing npm to skip repeated metadata resolutions for previously-installed packages.
在 package.json
中,您可以指定您在应用中使用的 npm 包。换句话说,你有一个特定的依赖关系,所以你的包可以运行。
package-lock.json
是您的应用程序使用 和它们的依赖项 的每个包的大“ map ”,您不能影响。
在你的例子中,grunt-angular-translate
对 "lodash": "~2.4.1"
有它自己的依赖,你可以不要更改它,也不应尝试更改它,因为该软件包应该与该版本一起使用,而不是与可能存在大量重大更改的 2 个版本更高的软件包一起使用。
您可以将 lodash 的直接依赖项升级到其最新版本,但这不会将 grunt-angular-translate
对 lodash 的依赖项更新到该版本,它确实不应该。
真正应该发生的是在您的 node_modules
文件夹中,您将获得更新的 lodash(您可以通过查看它的 package.json 和里面的版本来检查)。在同一个文件夹中,如果你进入 grunt-angular-translate
文件夹并查看它自己的 node_modules
...它应该有自己的 lodash 文件夹和 lodash 2.4.1
在里面。
关于npm - 如何更新 package-lock.json 中的一个包的依赖,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56150065/
我想知道锁是如何在 Java 中实现的。在一些教程中,我发现它们应该使用 wait() 和 notify()/notifyAll() 以及一些 boolean 标志来实现(它可能比那复杂得多,但基本上
我正在开发一个多线程服务器,用于存储和读取来自数据库的信息。数据库是用 RocksDB 实现的。 我遇到的问题是,当我一次从多个线程访问数据库时,我得到了那个错误。 通常是说db在usign后没有被删
例如,这里有一些 linux 中的代码: void set_leds(int val) { int fd = open ("/dev/console", O_WRONLY); // argumen
关闭。这个问题需要更多focused .它目前不接受答案。 想改进这个问题吗? 更新问题,使其只关注一个问题 editing this post . 关闭 9 年前。 Improve this qu
考虑以下代码。为了防止IndexOutOfBoundsException打电话时 listIterator ,我们使用读取器锁来检索基于索引的 iteartor,并在对 stockCodes 进行写操
这个问题在这里已经有了答案: Java locking structure best pattern (2 个答案) 关闭 6 年前。 有什么区别: private Lock lock = new
是否可以在网页加载时检查 Scroll Lock、Num Lock 和 Caps Lock 的状态?我找到了使用 JavaScript 在按键后进行检查的方法,但这不是我要问的。 最佳答案 2019
是否可以在网页加载时检查 Scroll Lock、Num Lock 和 Caps Lock 的状态?我找到了使用 JavaScript 在按键后进行检查的方法,但这不是我要问的。 最佳答案 2019
在Ubuntu中安装某些东西时出现错误。我尝试了一些命令来杀死正在运行的进程,但仍然遇到相同的错误。 最佳答案 根据文章How to Fix “Waiting for cache lock: Coul
我们有一个gradle构建,它可以动态创建GradleBuild类型的多个任务,以与不同的客户端库版本一起运行以测试其兼容性。在Gradle4上可以正常工作,但是在移至Gradle5后,执行第一项任务
我在尝试运行在 vertica 数据库表上运行查询的客户端应用程序时反复遇到此错误。 有人可以帮助解决这个问题吗? 最佳答案 我想知道您的客户端应用程序向 Vertica 发送了哪种“查询”(以 RE
我有一个创建锁的方法。 ReadWriteLock lock = new ReentrantReadWriteLock(); 然后我使用 Lock Interface 将该对象传递到一个方法中。 m
正如问题所问,我知道这是可能的on Linux ,但我找不到任何适用于 Windows 的最新信息。有可能吗? 最佳答案 您可以使用 ctypes 加载 user32.dll 然后调用 GetKeyS
这是同一个问题 Change keyboard locks in Python或者 How to change caps lock status without key press . 但还是有区别的
与 this question 相同,不知道为什么Java团队没有在Lock中添加一些默认方法界面,类似这样: public default void withLock(Runnable r) {
我有一个带有package-lock.json文件的项目。 现在,我想基于yarn.lock文件或项目的现有package-lock.json生成node_modules文件。 我怎样才能做到这一点?
我正在查看 pthreadtypes.h 文件中的 pthread_mutex_t 结构。 “__lock”代表什么?它就像分配给互斥锁的锁号吗? typedef union { struct _
我正在研究避免死锁的措施,其中一种可能的方法是通过强制线程放弃它在访问另一个锁但无法访问该锁时已经持有的锁来打破循环等待。 以最简单的银行账户转账为例: class Account { priva
我被要求支持一些遗留代码,我看到了一些让我摸不着头脑的事情。在某些代码段中,我看到类实例使用 CMutex 实例来同步方法执行。例如 class CClassA : public CObject {
当我们调用 lock.lock() 或尝试进入一个 synchronized block 时,如果其他线程已经获取了该锁,我们的线程就会阻塞。现在我的问题是,当我们查看 lock.lock() 的实现
我是一名优秀的程序员,十分优秀!