M
M
Maxim2020-01-24 14:14:35
npm
Maxim, 2020-01-24 14:14:35

How to update installed packages in Node?

When I run npm outdated --depth=0 , the console responds:
Package Current Wanted Latest Location
grunt-contrib-watch 0.3.1 0.3.1 1.1.0 energy
I understand this package needs to be updated.
What is the command to update it?
When executing this npm update --save command, the console does not write anything.
I also ran the npm update grunt-contrib-watch command.
Contents of package:
{
"author": "Maxim",
"name": "energy",
"version": "1.0.0",
"devDependencies": {
"grunt": ">= 0.4",
"grunt-cli" : ">= 0.1.6",
"
"load-grunt-tasks": "^5.1.0"
}
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Belyaev, 2020-01-24
@mironov_m

npm i -D [email protected]

S
Sergey delphinpro, 2020-01-24
@delphinpro

Version 1.1.0 has been released.
But in your project, the restriction is on the minor version.
With a tilde, the version can be updated within the minor version, but the major version will not be updated because according to semver, the major version can break backward compatibility.
upd
probably explained crookedly ...
in general, the record ~ ​​0.3.1 allows updating to version 0.4, but not including it

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question