-
-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Forcing [email protected] to fix the issue: #367
- Loading branch information
1 parent
9ac253c
commit 31bd3c9
Showing
3 changed files
with
25 additions
and
3 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
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 |
---|---|---|
@@ -1,3 +1,25 @@ | ||
const { execSync } = require('child_process'); | ||
const semver = require('semver'); | ||
|
||
const requiredVersionRange = '>=6.x <=8.16.0'; | ||
|
||
try { | ||
const npmVersion = execSync('npm -v').toString().trim(); | ||
|
||
if (!semver.satisfies(npmVersion, requiredVersionRange)) { | ||
console.error( | ||
`Error: This project requires npm version ${requiredVersionRange}. You have version ${npmVersion}.\nPlease downgrade your npm, this is due to a bug in node-gyp. Github issue: https://github.com/ganeshrvel/openmtp/issues/367.\ncommand: npm install -g [email protected]` | ||
); | ||
process.exit(1); | ||
} | ||
|
||
console.info(`Using compatible npm version: ${npmVersion}`); | ||
} catch (error) { | ||
console.error('Error checking npm version:', error); | ||
|
||
process.exit(1); | ||
} | ||
|
||
if (!/yarn\.js$/.test(process.env.npm_execpath || '')) { | ||
console.warn( | ||
"\u001b[33mYou don't seem to be using yarn. This could produce unexpected results.\u001b[39m" | ||
|
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 |
---|---|---|
|
@@ -235,7 +235,7 @@ | |
}, | ||
"devEngines": { | ||
"node": ">=16.x", | ||
"npm": ">=6.x", | ||
"npm": ">=6.x <=8.16.0", | ||
"yarn": ">=0.21.3" | ||
} | ||
} |