V
V
Vitalik Cherny2016-09-30 07:43:24
Node.js
Vitalik Cherny, 2016-09-30 07:43:24

How to update tasks (package.json)?

I installed it in an npm project, and in package.json I saved the packages that I use.
How do I upgrade packages to a newer version?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Sergeevich, 2016-09-30
@Devinora

Well, as I understand it, you need to update dependencies, not tasks.
Tasks are bash commands that you can store in package.json and call them with npm run task_name , used when you don't want to type something like this often: node index.js --some-param1 --some-param2 123 - -log command too often, you save it in a task and then run it with the help of the npm run task_name command
All your dependencies are listed in the "dependencies" and "devDependencies" field (modules that are used for development, for example, the webpack collector)
For each dependency, its semver syntax version (if you can call it that) is indicated.
Example:

"dependencies": {
    "python-shell": "^0.4.0"
}

This version entry: ^1.2.3 says that the version can be higher than 1.2.3 but not more than 2.0.0 therefore with the command:
npm update all dependencies will be updated if there is a newer version
More details here: https://www .youtube.com/watch?v=CrevZgTc7ow

V
Vitalik Cherny, 2016-09-30
@Devinora

27a37adf8168469285029e66827bcc99.png
I am not very strong in programming, and I am not very friendly with gulp yet.
when I put gulp in the project, I write - npm init (I create package.json), and then I save dependencies via --save-dev, but I don't know how to update them.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question