Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 635 Vote(s) - 3.58 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to update each dependency in package.json to the latest version?

#11
Greenkeeper if you're using Github.

[To see links please register here]



It's a Github integration and incredibly easy to set things up. When installed, it automatically creates pull requests in repositories you specify (or all if wanted) and keeps your code always up-to-date, without forcing you to do anything manually. PRs should then trigger a build on a CI service and depending on a successful or failed check you can keep figuring out what's triggering the issue or when CI passes simply merge the PR.

[![greenkeeper PR 1][1]][1]
[![greenkeeper PR 2][2]][2]

At the bottom, you can see that the first build failed at first and after a commit ("upgrade to node v6.9") the tests pass so I could finally merge the PR. Comes with a lot of emoji, too.

Another alternative would be

[To see links please register here]

, however I didn't test it intensively. After a first look Greenkeeper looks better in general IMO and has better integration.


[1]:

[2]:
Reply

#12
- npm outdated
- npm update

Should get you the latest wanted versions compatible for your app. But not the latest versions.
Reply

#13
If you are using `yarn`, [`yarn upgrade-interactive`](

[To see links please register here]

) is a really sleek tool that can allow you to view your outdated dependencies and then select which ones you want to update.

More reasons to use Yarn over `npm`. Heh.
Reply

#14
Try following command if you using npm 5 and node 8

npm update --save
Reply

#15
Commands that I had to use to update `package.json` for `NPM 3.10.10`:

npm install -g npm-check-updates
ncu -a
npm install

Background:

I was using the latest command from @josh3736 but my `package.json` was not updated. I then noticed the description text when running `npm-check-updates -u`:

> The following dependency is satisfied by its declared version range,
> but the installed version is behind. You can install the latest
> version without modifying your package file by using npm update. If
> you want to update the dependency in your package file anyway, run ncu
> -a.

Reading the documentation for npm-check-updates you can see the difference:

[To see links please register here]


> -u, --upgrade: overwrite package file
>
> -a, --upgradeAll: include even those dependencies whose latest version satisfies the declared semver dependency

ncu is an alias for `npm-check-updates` as seen in the message when typing `npm-check-updates -u`:

[INFO]: You can also use ncu as an alias
Reply

#16
The following code (which was accepted) wrote me something like "it takes too long blah-blah" and did nothing. Probably using the global flag was the problem, idk.

npm i -g npm-check-updates
ncu -u
npm install

I decided to use my text editor and follow a semi-manual approach instead.

I copied a list like this (just a lot longer) from the dev dependencies of my `package.json` to the notepad++ text editor:

"browserify": "10.2.6",
"expect.js": "^0.3.1",
"karma": "^0.13.22",
"karma-browserify": "^5.2.0",

I set the search mode to regular expression, used the `^\s*"([^"]+)".*$` pattern to get the package name and replaced it with `npm uninstall \1 --save-dev \nnpm install \1 --save-dev`. Clicked on "replace all". The otput was this:

npm uninstall browserify --save-dev
npm install browserify --save-dev
npm uninstall expect.js --save-dev
npm install expect.js --save-dev
npm uninstall karma --save-dev
npm install karma --save-dev
npm uninstall karma-browserify --save-dev
npm install karma-browserify --save-dev

I copied it back to bash and hit enter. Everything was upgraded and working fine. That's all.

"browserify": "^16.1.0",
"expect.js": "^0.3.1",
"karma": "^2.0.0",
"karma-browserify": "^5.2.0",

I don't think it is a big deal, since you have to do it only every now and then, but you can easily write a script, which parses the `package.json` and upgrades your packages. I think it is better this way, because you can edit your list if you need something special, for example keeping the current version of a lib.
Reply

#17
If you use yarn, the following command updates all packages to their latest version:

`yarn upgrade --latest`

From their [docs][1]:
> The `upgrade --latest` command upgrades packages the same as the upgrade command, but ignores the version range specified in package.json. Instead, the version specified by the latest tag will be used (potentially upgrading the packages across major versions).


[1]:

[To see links please register here]

Reply

#18
I solved this by seeing the instructions from

[To see links please register here]


$ npm install -g npm-check-updates
$ ncu
$ ncu -u # to update all the dependencies to latest
$ ncu -u "specific module name" #in case you want to update specific dependencies to latest
Reply

#19
If you want to use a gentle approach via a beautiful (for terminal) interactive reporting interface I would suggest using [npm-check][1].

It's less of a hammer and gives you more consequential knowledge of, and control over, your dependency updates.

To give you a taste of what awaits here's a screenshot (scraped from the git page for npm-check):

[![enter image description here][2]][2]


[1]:

[To see links please register here]

[2]:
Reply

#20
This feature has been introduced in `npm v5`. update to npm using `npm install -g npm@latest` and

to update `package.json`

1. delete `/node_modules` and `package-lock.json (if you have any)`

2. run `npm update`. this will update the dependencies package.json to the latest, based on [semver](

[To see links please register here]

).


to update to very latest version. you can go with `npm-check-updates`
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through