Revert "Check detected npm path is existing"

This reverts commit 1fda3a4165.
This commit is contained in:
Mohamed Hegazy 2018-05-25 14:54:53 -07:00
parent 198722d46a
commit 832893e559

View file

@ -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 {