Skip to content

Commit

Permalink
fix: npm-run-path is actually needed
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Jan 25, 2024
1 parent 7e3f0a8 commit dd8f69c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"debug": "^4.3.4",
"npm": "10.2.3",
"npm-package-arg": "^11.0.1",
"npm-run-path": "^5.2.0",
"semver": "^7.5.4",
"validate-npm-package-name": "^5.0.0"
},
Expand Down
2 changes: 2 additions & 0 deletions src/npm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {fork as cpFork} from 'node:child_process'
import {readFile} from 'node:fs/promises'
import {createRequire} from 'node:module'
import {join, sep} from 'node:path'
import {npmRunPathEnv} from 'npm-run-path'

import {LogLevel} from './log-level.js'

Expand All @@ -23,6 +24,7 @@ async function fork(modulePath: string, args: string[] = [], {cwd, silent}: Exec
const forked = cpFork(modulePath, args, {
cwd,
env: {
...npmRunPathEnv(),
// Disable husky hooks because a plugin might be trying to install them, which will
// break the install since the install location isn't a .git directory.
HUSKY: '0',
Expand Down
14 changes: 7 additions & 7 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6451,20 +6451,20 @@ npm-run-path@^4.0.1:
dependencies:
path-key "^3.0.0"

npm-run-path@^5:
version "5.2.0"
resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-5.2.0.tgz#224cdd22c755560253dd71b83a1ef2f758b2e955"
integrity sha512-W4/tgAXFqFA0iL7fk0+uQ3g7wkL8xJmx3XdK0VGb4cHW//eZTtKGvFBBoRKVTpY7n6ze4NL9ly7rgXcHufqXKg==
dependencies:
path-key "^4.0.0"

npm-run-path@^5.1.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-5.1.0.tgz#bc62f7f3f6952d9894bd08944ba011a6ee7b7e00"
integrity sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==
dependencies:
path-key "^4.0.0"

npm-run-path@^5.2.0:
version "5.2.0"
resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-5.2.0.tgz#224cdd22c755560253dd71b83a1ef2f758b2e955"
integrity sha512-W4/tgAXFqFA0iL7fk0+uQ3g7wkL8xJmx3XdK0VGb4cHW//eZTtKGvFBBoRKVTpY7n6ze4NL9ly7rgXcHufqXKg==
dependencies:
path-key "^4.0.0"

npm-user-validate@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/npm-user-validate/-/npm-user-validate-2.0.0.tgz#7b69bbbff6f7992a1d9a8968d52fd6b6db5431b6"
Expand Down

0 comments on commit dd8f69c

Please sign in to comment.