Skip to content

Commit 832893e

Browse files
committed
Revert "Check detected npm path is existing"
This reverts commit 1fda3a4.
1 parent 198722d commit 832893e

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/server/typingsInstaller/nodeTypingsInstaller.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
namespace ts.server.typingsInstaller {
44
const fs: {
5-
appendFileSync(file: string, content: string): void;
6-
existsSync(path: string): boolean;
5+
appendFileSync(file: string, content: string): void
76
} = require("fs");
87

98
const path: {
@@ -33,12 +32,11 @@ namespace ts.server.typingsInstaller {
3332
/** Used if `--npmLocation` is not passed. */
3433
function getDefaultNPMLocation(processName: string) {
3534
if (path.basename(processName).indexOf("node") === 0) {
36-
const npmPath = `"${path.join(path.dirname(process.argv[0]), "npm")}"`;
37-
if (fs.existsSync(npmPath)) {
38-
return npmPath;
39-
}
35+
return `"${path.join(path.dirname(process.argv[0]), "npm")}"`;
36+
}
37+
else {
38+
return "npm";
4039
}
41-
return "npm";
4240
}
4341

4442
interface TypesRegistryFile {

0 commit comments

Comments
 (0)