libnpmexec 8.1.3 → 9.0.0

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 +12 -7
  2. package/package.json +17 -16
package/lib/index.js CHANGED
@@ -202,14 +202,19 @@ const exec = async (opts) => {
202
202
  args[0] = getBinFromManifest(commandManifest)
203
203
 
204
204
  if (needInstall.length > 0 && globalPath) {
205
- // See if the package is installed globally, and run the translated bin
205
+ // See if the package is installed globally. If it is, run the translated bin
206
206
  const globalArb = new Arborist({ ...flatOptions, path: globalPath, global: true })
207
- const globalTree = await globalArb.loadActual()
208
- const { manifest: globalManifest } =
209
- await missingFromTree({ spec, tree: globalTree, flatOptions, shallow: true })
210
- if (!globalManifest && await fileExists(`${globalBin}/${args[0]}`)) {
211
- binPaths.push(globalBin)
212
- return await run()
207
+ const globalTree = await globalArb.loadActual().catch(() => {
208
+ log.verbose(`Could not read global path ${globalPath}, ignoring`)
209
+ return null
210
+ })
211
+ if (globalTree) {
212
+ const { manifest: globalManifest } =
213
+ await missingFromTree({ spec, tree: globalTree, flatOptions, shallow: true })
214
+ if (!globalManifest && await fileExists(`${globalBin}/${args[0]}`)) {
215
+ binPaths.push(globalBin)
216
+ return await run()
217
+ }
213
218
  }
214
219
  }
215
220
  }
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "libnpmexec",
3
- "version": "8.1.3",
3
+ "version": "9.0.0",
4
4
  "files": [
5
5
  "bin/",
6
6
  "lib/"
7
7
  ],
8
8
  "main": "lib/index.js",
9
9
  "engines": {
10
- "node": "^16.14.0 || >=18.0.0"
10
+ "node": "^18.17.0 || >=20.5.0"
11
11
  },
12
12
  "description": "npm exec (npx) programmatic API",
13
13
  "repository": {
@@ -33,13 +33,14 @@
33
33
  ],
34
34
  "license": "ISC",
35
35
  "scripts": {
36
- "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"",
36
+ "lint": "npm run eslint",
37
37
  "posttest": "npm run lint",
38
38
  "test": "tap",
39
39
  "snap": "tap",
40
40
  "postlint": "template-oss-check",
41
- "lintfix": "npm run lint -- --fix",
42
- "template-oss-apply": "template-oss-apply --force"
41
+ "lintfix": "npm run eslint -- --fix",
42
+ "template-oss-apply": "template-oss-apply --force",
43
+ "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\""
43
44
  },
44
45
  "tap": {
45
46
  "files": "test/*.js",
@@ -49,30 +50,30 @@
49
50
  ]
50
51
  },
51
52
  "devDependencies": {
52
- "@npmcli/eslint-config": "^4.0.0",
53
+ "@npmcli/eslint-config": "^5.0.1",
53
54
  "@npmcli/mock-registry": "^1.0.0",
54
- "@npmcli/template-oss": "4.22.0",
55
- "bin-links": "^4.0.4",
55
+ "@npmcli/template-oss": "4.23.3",
56
+ "bin-links": "^5.0.0",
56
57
  "chalk": "^5.2.0",
57
58
  "just-extend": "^6.2.0",
58
59
  "just-safe-set": "^4.2.1",
59
60
  "tap": "^16.3.8"
60
61
  },
61
62
  "dependencies": {
62
- "@npmcli/arborist": "^7.5.4",
63
- "@npmcli/run-script": "^8.1.0",
63
+ "@npmcli/arborist": "^8.0.0",
64
+ "@npmcli/run-script": "^9.0.1",
64
65
  "ci-info": "^4.0.0",
65
- "npm-package-arg": "^11.0.2",
66
- "pacote": "^18.0.6",
67
- "proc-log": "^4.2.0",
68
- "read": "^3.0.1",
69
- "read-package-json-fast": "^3.0.2",
66
+ "npm-package-arg": "^12.0.0",
67
+ "pacote": "^19.0.0",
68
+ "proc-log": "^5.0.0",
69
+ "read": "^4.0.0",
70
+ "read-package-json-fast": "^4.0.0",
70
71
  "semver": "^7.3.7",
71
72
  "walk-up-path": "^3.0.1"
72
73
  },
73
74
  "templateOSS": {
74
75
  "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
75
- "version": "4.22.0",
76
+ "version": "4.23.3",
76
77
  "content": "../../scripts/template-oss/index.js"
77
78
  }
78
79
  }