Revert "Check detected npm path is existing"
This reverts commit 1fda3a4165
.
This commit is contained in:
parent
198722d46a
commit
832893e559
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue