File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,8 +5,6 @@ import cmdShim from 'cmd-shim'
55import constants from '../constants'
66import { findBinPathDetails } from '../utils/path-resolve'
77
8- const { WIN32 , rootDistPath } = constants
9-
108export async function installLinks (
119 realBinPath : string ,
1210 binName : 'npm' | 'npx'
@@ -21,6 +19,8 @@ export async function installLinks(
2119 )
2220 process . exit ( 127 )
2321 }
22+ // Lazily access constants.WIN32.
23+ const { WIN32 } = constants
2424 // TODO: Is this early exit needed?
2525 if ( WIN32 && binPath ) {
2626 return binPath
@@ -29,7 +29,8 @@ export async function installLinks(
2929 if ( ! shadowed ) {
3030 if ( WIN32 ) {
3131 await cmdShim (
32- path . join ( rootDistPath , `${ binName } -cli.js` ) ,
32+ // Lazily access constants.rootDistPath.
33+ path . join ( constants . rootDistPath , `${ binName } -cli.js` ) ,
3334 path . join ( realBinPath , binName )
3435 )
3536 }
You can’t perform that action at this time.
0 commit comments