Skip to content

Commit fe6eb97

Browse files
author
Nicholas Pape
authored
Fix issue where BaseCmdTask was invoking the wrong version of Node.js (microsoft#760)
* Fix an issue in BaseCmdTask.ts where it was using the wrong version of Node.js * Add changefiles * Update BaseCmdTask.ts
1 parent 4cf5f30 commit fe6eb97

File tree

4 files changed

+28
-1
lines changed

4 files changed

+28
-1
lines changed

apps/rush-lib/src/scripts/install-run.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ export function getNpmPath(): string {
125125
// We're on Windows
126126
const whereOutput: string = childProcess.execSync('where npm', { stdio: [] }).toString();
127127
const lines: string[] = whereOutput.split(os.EOL).filter((line) => !!line);
128+
129+
// take the last result, we are looking for a .cmd command
130+
// see https://github.com/Microsoft/web-build-tools/issues/759
128131
_npmPath = lines[lines.length - 1];
129132
} else {
130133
// We aren't on Windows - assume we're on *NIX or Darwin
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@microsoft/gulp-core-build-typescript",
5+
"comment": "Fix an issue where the TscTask and TslintTasks where invoking the wrong version of Node.js",
6+
"type": "patch"
7+
}
8+
],
9+
"packageName": "@microsoft/gulp-core-build-typescript",
10+
"email": "nickpape-msft@users.noreply.github.com"
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"comment": "",
5+
"packageName": "@microsoft/rush",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@microsoft/rush",
10+
"email": "nickpape-msft@users.noreply.github.com"
11+
}

core-build/gulp-core-build-typescript/src/miniTasks/BaseCmdTask.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ export abstract class BaseCmdTask<TTaskConfig extends IBaseCmdTaskConfig> extend
6464
// We're on Windows
6565
const whereOutput: string = childProcess.execSync('where node', { stdio: [] }).toString();
6666
const lines: string[] = whereOutput.split(os.EOL).filter((line) => !!line);
67-
BaseCmdTask.__nodePath = lines[lines.length - 1];
67+
68+
// take the first result, see https://github.com/Microsoft/web-build-tools/issues/759
69+
BaseCmdTask.__nodePath = lines[0];
6870
} else {
6971
// We aren't on Windows - assume we're on *NIX or Darwin
7072
BaseCmdTask.__nodePath = childProcess.execSync('which node', { stdio: [] }).toString();

0 commit comments

Comments
 (0)