Skip to content

Commit

Permalink
fix(main/nodejs{,-lts}): patch npm to not check for updates
Browse files Browse the repository at this point in the history
This should hopefully silence people complaining of unable to update but
npm is showing an update being available.

Closes #13293
  • Loading branch information
thunder-coding committed Feb 21, 2024
1 parent 1a16585 commit 2a63b01
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/nodejs-lts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ TERMUX_PKG_DESCRIPTION="Open Source, cross-platform JavaScript runtime environme
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="Yaksh Bariya <thunder-coding@termux.dev>"
TERMUX_PKG_VERSION=20.11.1
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL=https://nodejs.org/dist/v${TERMUX_PKG_VERSION}/node-v${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_SHA256=77813edbf3f7f16d2d35d3353443dee4e61d5ee84d9e3138c7538a3c0ca5209e
# Note that we do not use a shared libuv to avoid an issue with the Android
Expand Down
15 changes: 15 additions & 0 deletions packages/nodejs-lts/deps-npm-lib-npm.js.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--- ./deps/npm/lib/npm.js.orig 2024-02-21 20:21:11.251716444 +0530
+++ ./deps/npm/lib/npm.js 2024-02-21 20:25:09.207937428 +0530
@@ -113,12 +113,6 @@

const timeEnd = this.time(`command:${cmd}`)

- // this is async but we dont await it, since its ok if it doesnt
- // finish before the command finishes running. it uses command and argv
- // so it must be initiated here, after the command name is set
- // eslint-disable-next-line promise/catch-or-return
- updateNotifier(this).then((msg) => (this.updateNotification = msg))
-
// Options are prefixed by a hyphen-minus (-, \u2d).
// Other dash-type chars look similar but are invalid.
if (!this.#warnedNonDashArg) {
1 change: 1 addition & 0 deletions packages/nodejs/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ TERMUX_PKG_DESCRIPTION="Open Source, cross-platform JavaScript runtime environme
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="Yaksh Bariya <thunder-coding@termux.dev>"
TERMUX_PKG_VERSION=21.6.2
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL=https://nodejs.org/dist/v${TERMUX_PKG_VERSION}/node-v${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_SHA256=191294d445d1e6800359acc8174529b1e18e102147dc5f596030d3dce96931e5
# thunder-coding: don't try to autoupdate nodejs, that thing takes 2 whole hours to build for a single arch, and requires a lot of patch updates everytime. Also I run tests everytime I update it to ensure least bugs
Expand Down
15 changes: 15 additions & 0 deletions packages/nodejs/deps-npm-lib-npm.js.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--- ./deps/npm/lib/npm.js.orig 2024-02-21 20:21:11.251716444 +0530
+++ ./deps/npm/lib/npm.js 2024-02-21 20:25:09.207937428 +0530
@@ -113,12 +113,6 @@

const timeEnd = this.time(`command:${cmd}`)

- // this is async but we dont await it, since its ok if it doesnt
- // finish before the command finishes running. it uses command and argv
- // so it must be initiated here, after the command name is set
- // eslint-disable-next-line promise/catch-or-return
- updateNotifier(this).then((msg) => (this.updateNotification = msg))
-
// Options are prefixed by a hyphen-minus (-, \u2d).
// Other dash-type chars look similar but are invalid.
if (!this.#warnedNonDashArg) {

0 comments on commit 2a63b01

Please sign in to comment.