Skip to content

Commit 2404704

Browse files
committed
feat: drop node 10, 11, and programmatic api
BREAKING CHANGE: This will drop official support for node versions less than v12. It also removes the `main` export as something that will work, effectively dropping a supported programmatic api via `require('npm')`
1 parent 2def17a commit 2404704

File tree

4 files changed

+17
-11
lines changed

4 files changed

+17
-11
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
strategy:
5959
fail-fast: false
6060
matrix:
61-
node-version: [10.x, 12.x, 14.x, 16.x]
61+
node-version: [12.x, 14.x, 16.x]
6262
platform:
6363
- os: ubuntu-latest
6464
shell: bash
@@ -100,7 +100,7 @@ jobs:
100100
strategy:
101101
fail-fast: false
102102
matrix:
103-
node-version: [10.x, 12.x, 14.x, 16.x]
103+
node-version: [12.x, 14.x, 16.x]
104104
platform:
105105
- os: ubuntu-latest
106106
shell: bash
@@ -141,7 +141,7 @@ jobs:
141141
strategy:
142142
fail-fast: false
143143
matrix:
144-
node-version: ['10.1', 10.x, '12.1', 12.x, '14.1', 14.x, '16.1', 16.x]
144+
node-version: ['12.13.0', 12.x, '14.15.0', 14.x, '16.1', 16.x]
145145
platform:
146146
- os: ubuntu-latest
147147
shell: bash

lib/no-api.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
throw new Error('The programmatic API was removed in npm v8.0.0')

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,17 @@
3838
"lib": "./lib",
3939
"man": "./man"
4040
},
41-
"main": "./lib/npm.js",
41+
"main": "./lib/no-api.js",
4242
"bin": {
4343
"npm": "bin/npm-cli.js",
4444
"npx": "bin/npx-cli.js"
4545
},
4646
"exports": {
4747
".": [
4848
{
49-
"default": "./lib/npm.js"
49+
"default": "./lib/no-api.js"
5050
},
51-
"./lib/npm.js"
51+
"./lib/no-api.js"
5252
],
5353
"./package.json": "./package.json"
5454
},
@@ -235,6 +235,6 @@
235235
},
236236
"license": "Artistic-2.0",
237237
"engines": {
238-
"node": ">=10"
238+
"node": "^12.13.0 || ^14.15.0 || >=16"
239239
}
240240
}

test/lib/utils/unsupported.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,15 @@ const versions = [
2727
['v7.2.3', false, true],
2828
['v8.4.0', false, true],
2929
['v9.3.0', false, true],
30-
['v10.0.0-0', false, false],
31-
['v11.0.0-0', false, false],
32-
['v12.0.0-0', false, false],
33-
['v13.0.0-0', false, false],
30+
['v10.0.0-0', false, true],
31+
['v11.0.0-0', false, true],
32+
['v12.0.0-0', false, true],
33+
['v12.13.0-0', false, false],
34+
['v13.0.0-0', false, true],
35+
['v14.0.0-0', false, true],
36+
['v14.15.0-0', false, false],
37+
['v15.0.0-0', false, true],
38+
['v16.0.0-0', false, false],
3439
]
3540

3641
t.test('versions', function (t) {

0 commit comments

Comments
 (0)