diff --git a/package.json b/package.json index e36ca466b34b1..ce5765979fc45 100644 --- a/package.json +++ b/package.json @@ -117,7 +117,6 @@ "@types/semver": "^7.3.8", "@types/tar-stream": "^2.2.2", "@types/tmp": "^0.2.0", - "@types/which": "^2.0.2", "@types/yargs": "^17.0.10", "@types/yarnpkg__lockfile": "^1.1.5", "@typescript-eslint/eslint-plugin": "5.38.1", @@ -315,8 +314,7 @@ "tailwindcss": "3.2.4", "tslib": "^2.3.0", "vitest": "^0.25.8", - "weak-napi": "^2.0.2", - "which": "^3.0.0" + "weak-napi": "^2.0.2" }, "resolutions": { "**/xmlhttprequest-ssl": "~1.6.2", @@ -336,3 +334,4 @@ ] } } + diff --git a/packages/nx/package.json b/packages/nx/package.json index 4b37c4fd84718..1a4bc29f0ce84 100644 --- a/packages/nx/package.json +++ b/packages/nx/package.json @@ -63,7 +63,6 @@ "tsconfig-paths": "^4.1.2", "tslib": "^2.3.0", "v8-compile-cache": "2.3.0", - "which": "^3.0.0", "yargs": "^17.6.2", "yargs-parser": "21.1.1" }, diff --git a/packages/nx/src/daemon/client/client.ts b/packages/nx/src/daemon/client/client.ts index 470bdc8f1bba9..f42fb18badb23 100644 --- a/packages/nx/src/daemon/client/client.ts +++ b/packages/nx/src/daemon/client/client.ts @@ -6,7 +6,6 @@ import { ensureDirSync, ensureFileSync } from 'fs-extra'; import { connect } from 'net'; import { join } from 'path'; import { performance } from 'perf_hooks'; -import * as which from 'which'; import { output } from '../../utils/output'; import { FULL_OS_SOCKET_PATH, killSocketOrPath } from '../socket-utils'; import { @@ -325,11 +324,9 @@ export class DaemonClient { this._out = await open(DAEMON_OUTPUT_LOG_FILE, 'a'); this._err = await open(DAEMON_OUTPUT_LOG_FILE, 'a'); - // Find the node path based on the path. - // This allows us to use the node version based on the host os, rather than other host processes - const nodeExecutable = await which('node'); + const backgroundProcess = spawn( - nodeExecutable, + process.execPath, [join(__dirname, '../server/start.js')], { cwd: workspaceRoot, diff --git a/yarn.lock b/yarn.lock index cd9921a5365d0..0d69d0e018c9e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8047,11 +8047,6 @@ anymatch "^3.0.0" source-map "^0.6.0" -"@types/which@^2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@types/which/-/which-2.0.2.tgz#54541d02d6b1daee5ec01ac0d1b37cecf37db1ae" - integrity sha512-113D3mDkZDjo+EeUEHCFy0qniNc1ZpecGiAU7WSo7YDoSzolZIQKpYFHrPpjkB2nuyahcKfrmLXeQlh7gqJYdw== - "@types/ws@^8.5.1": version "8.5.3" resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.3.tgz#7d25a1ffbecd3c4f2d35068d0b283c037003274d"