Skip to content

Discussion to improve reliability on Windows #21

@veljkoz

Description

@veljkoz

This line:

prefix = process.env.APPDATA

//...
if (isWindows()) {

    // c:\node\node.exe --> prefix=c:\node\

    prefix = process.env.APPDATA

      ? path.join(process.env.APPDATA, 'npm')

      : path.dirname(process.execPath);

  } else {
//...

It would've give proper results without assuming the npm is under the APPDATA, i.e. if it's just:

prefix = path.dirname(process.execPath);

Is there any reason for assuming the npm runs under the APPDATA path?

Currently, this gives back the wrong prefix on Windows with nvm (node v8.11.1; nvm 1.1.5)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions