File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
src/server/typingsInstaller Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change 2
2
3
3
namespace ts . server . typingsInstaller {
4
4
const fs : {
5
- appendFileSync ( file : string , content : string ) : void ;
6
- existsSync ( path : string ) : boolean ;
5
+ appendFileSync ( file : string , content : string ) : void
7
6
} = require ( "fs" ) ;
8
7
9
8
const path : {
@@ -33,12 +32,11 @@ namespace ts.server.typingsInstaller {
33
32
/** Used if `--npmLocation` is not passed. */
34
33
function getDefaultNPMLocation ( processName : string ) {
35
34
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" ;
40
39
}
41
- return "npm" ;
42
40
}
43
41
44
42
interface TypesRegistryFile {
You can’t perform that action at this time.
0 commit comments