-
Notifications
You must be signed in to change notification settings - Fork 547
Open
Labels
Enhancementnew feature or improvementnew feature or improvementsemver:majorbackwards-incompatible breaking changesbackwards-incompatible breaking changes
Milestone
Description
What / Why
It would be nice to have
satisfiesthrow an error so that we may see that the range does not satisfy due to an invalid range as opposed to an invalid version. The range error that we'd like to see is here:Line 41 in cb1ca1d
throw new TypeError(`Invalid SemVer Range: ${range}`)
When
- When verifying engine versions during
npm install - When adding a dependency to package.json during
npm install
Where
- npm/node-semver
How
Current Behavior
Create an empty project with the following package.json:
{
"name": "foo",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"engines": {
"node": ">=6.5.0 !15"
},
"engineStrict": true
}Run npm install and you get:
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: 'foo@1.0.0',
npm WARN EBADENGINE required: { node: '>=6.5.0 !15' },
npm WARN EBADENGINE current: { node: 'v16.11.1', npm: '8.0.0' }
npm WARN EBADENGINE }
up to date, audited 1 package in 414ms
found 0 vulnerabilities
Expected Behavior
Create an empty project with the following package.json:
{
"name": "foo",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"engines": {
"node": ">=6.5.0 !15"
},
"engineStrict": true
}Run npm install and ideally get something like:
npm WARN EBADENGINE Invalid SemVer Range: >=6.5.0 !15
up to date, audited 1 package in 414ms
found 0 vulnerabilities
Who
- n/a
References
- n/a
AlanSl and WalkerCodeRanger
Metadata
Metadata
Assignees
Labels
Enhancementnew feature or improvementnew feature or improvementsemver:majorbackwards-incompatible breaking changesbackwards-incompatible breaking changes