Revert "Check detected npm path is existing"
This reverts commit 1fda3a4165
.
This commit is contained in:
parent
198722d46a
commit
832893e559
1 changed files with 5 additions and 7 deletions
|
@ -2,8 +2,7 @@
|
||||||
|
|
||||||
namespace ts.server.typingsInstaller {
|
namespace ts.server.typingsInstaller {
|
||||||
const fs: {
|
const fs: {
|
||||||
appendFileSync(file: string, content: string): void;
|
appendFileSync(file: string, content: string): void
|
||||||
existsSync(path: string): boolean;
|
|
||||||
} = require("fs");
|
} = require("fs");
|
||||||
|
|
||||||
const path: {
|
const path: {
|
||||||
|
@ -33,12 +32,11 @@ namespace ts.server.typingsInstaller {
|
||||||
/** Used if `--npmLocation` is not passed. */
|
/** Used if `--npmLocation` is not passed. */
|
||||||
function getDefaultNPMLocation(processName: string) {
|
function getDefaultNPMLocation(processName: string) {
|
||||||
if (path.basename(processName).indexOf("node") === 0) {
|
if (path.basename(processName).indexOf("node") === 0) {
|
||||||
const npmPath = `"${path.join(path.dirname(process.argv[0]), "npm")}"`;
|
return `"${path.join(path.dirname(process.argv[0]), "npm")}"`;
|
||||||
if (fs.existsSync(npmPath)) {
|
}
|
||||||
return npmPath;
|
else {
|
||||||
}
|
return "npm";
|
||||||
}
|
}
|
||||||
return "npm";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface TypesRegistryFile {
|
interface TypesRegistryFile {
|
||||||
|
|
Loading…
Reference in a new issue