-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(main/nodejs-{,-lts}: do not allow npm to upgrade itself
- Loading branch information
1 parent
75551dc
commit 80b32ba
Showing
4 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
packages/nodejs-lts/deps-npm-lib-commands-install.js.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- ./deps/npm/lib/commands/install.js.orig 2023-01-17 18:37:18.553261550 +0530 | ||
+++ ./deps/npm/lib/commands/install.js 2023-01-17 18:44:48.711879839 +0530 | ||
@@ -118,6 +118,18 @@ | ||
throw e | ||
} | ||
} | ||
+ try { | ||
+ if (forced) { | ||
+ log.warn( | ||
+ 'install', | ||
+ `Force installing npm version unpatched version of ${npmManifest.version}. This is very likely to break installation of global packages using npm. See https://github.com/termux/termux-packages/issues/13293` | ||
+ ) | ||
+ } else { | ||
+ throw new Error("Can't install npm globally as it will very likely break installation of global packages using npm. See https://github.com/termux/termux-packages/issues/13293") | ||
+ } | ||
+ } catch(e) { | ||
+ throw e | ||
+ } | ||
} | ||
|
||
// don't try to install the prefix into itself |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- ./deps/npm/lib/commands/install.js.orig 2023-01-06 02:53:25.000000000 +0530 | ||
+++ ./deps/npm/lib/commands/install.js 2023-01-17 18:45:53.985551449 +0530 | ||
@@ -119,6 +119,18 @@ | ||
throw e | ||
} | ||
} | ||
+ try { | ||
+ if (forced) { | ||
+ log.warn( | ||
+ 'install', | ||
+ `Force installing npm version unpatched version of ${npmManifest.version}. This is very likely to break installation of global packages using npm. See https://github.com/termux/termux-packages/issues/13293` | ||
+ ) | ||
+ } else { | ||
+ throw new Error("Can't install npm globally as it will very likely break installation of global packages using npm. See https://github.com/termux/termux-packages/issues/13293") | ||
+ } | ||
+ } catch(e) { | ||
+ throw e | ||
+ } | ||
} | ||
|
||
// don't try to install the prefix into itself |