mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-04-17 01:49:41 -05:00
Revert "Check detected npm path is existing"
This reverts commit 1fda3a4165.
This commit is contained in:
@@ -2,8 +2,7 @@
|
||||
|
||||
namespace ts.server.typingsInstaller {
|
||||
const fs: {
|
||||
appendFileSync(file: string, content: string): void;
|
||||
existsSync(path: string): boolean;
|
||||
appendFileSync(file: string, content: string): void
|
||||
} = require("fs");
|
||||
|
||||
const path: {
|
||||
@@ -33,12 +32,11 @@ namespace ts.server.typingsInstaller {
|
||||
/** Used if `--npmLocation` is not passed. */
|
||||
function getDefaultNPMLocation(processName: string) {
|
||||
if (path.basename(processName).indexOf("node") === 0) {
|
||||
const npmPath = `"${path.join(path.dirname(process.argv[0]), "npm")}"`;
|
||||
if (fs.existsSync(npmPath)) {
|
||||
return npmPath;
|
||||
}
|
||||
return `"${path.join(path.dirname(process.argv[0]), "npm")}"`;
|
||||
}
|
||||
else {
|
||||
return "npm";
|
||||
}
|
||||
return "npm";
|
||||
}
|
||||
|
||||
interface TypesRegistryFile {
|
||||
|
||||
Reference in New Issue
Block a user