libnpmexec 6.0.1 → 6.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/index.js +5 -3
  2. package/package.json +4 -4
package/lib/index.js CHANGED
@@ -245,9 +245,12 @@ const exec = async (opts) => {
245
245
 
246
246
  if (add.length) {
247
247
  if (!yes) {
248
+ const missingPackages = add.map(a => `${a.replace(/@$/, '')}`)
248
249
  // set -n to always say no
249
250
  if (yes === false) {
250
- throw new Error('canceled')
251
+ // Error message lists missing package(s) when process is canceled
252
+ /* eslint-disable-next-line max-len */
253
+ throw new Error(`npx canceled due to missing packages and no YES option: ${JSON.stringify(missingPackages)}`)
251
254
  }
252
255
 
253
256
  if (noTTY() || ciInfo.isCI) {
@@ -257,8 +260,7 @@ const exec = async (opts) => {
257
260
  add.map((pkg) => pkg.replace(/@$/, '')).join(', ')
258
261
  }`)
259
262
  } else {
260
- const addList = add.map(a => ` ${a.replace(/@$/, '')}`)
261
- .join('\n') + '\n'
263
+ const addList = missingPackages.join('\n') + '\n'
262
264
  const prompt = `Need to install the following packages:\n${
263
265
  addList
264
266
  }Ok to proceed? `
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "libnpmexec",
3
- "version": "6.0.1",
3
+ "version": "6.0.3",
4
4
  "files": [
5
5
  "bin/",
6
6
  "lib/"
@@ -51,7 +51,7 @@
51
51
  "devDependencies": {
52
52
  "@npmcli/eslint-config": "^4.0.0",
53
53
  "@npmcli/mock-registry": "^1.0.0",
54
- "@npmcli/template-oss": "4.14.1",
54
+ "@npmcli/template-oss": "4.18.0",
55
55
  "bin-links": "^4.0.1",
56
56
  "chalk": "^5.2.0",
57
57
  "just-extend": "^6.2.0",
@@ -59,7 +59,7 @@
59
59
  "tap": "^16.3.4"
60
60
  },
61
61
  "dependencies": {
62
- "@npmcli/arborist": "^6.2.10",
62
+ "@npmcli/arborist": "^6.3.0",
63
63
  "@npmcli/run-script": "^6.0.0",
64
64
  "ci-info": "^3.7.1",
65
65
  "npm-package-arg": "^10.1.0",
@@ -73,7 +73,7 @@
73
73
  },
74
74
  "templateOSS": {
75
75
  "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
76
- "version": "4.14.1",
76
+ "version": "4.18.0",
77
77
  "content": "../../scripts/template-oss/index.js"
78
78
  }
79
79
  }