Skip to content

NPM and NPX require NODE in PATH #24110

Description

@deinok

Any UNIX version of the Node Binaries like https://nodejs.org/dist/v11.1.0/node-v11.1.0-linux-x64.tar.xz require to have Node inside PATH.

How to reproduce

What is expected

I expect that runing the above commands work without having Node in the path

Activity

  1. richardlau commented on Nov 5, 2018

    @richardlau
    Member

    It used to work without having to have node in the PATH but at the request of the npm team it was changed (#6098). See #6095 for details.

  2. added
    npmIssues and PRs related to the npm client dependency or the npm registry.
    on Nov 5, 2018
  3. deinok commented on Nov 5, 2018

    @deinok
    Author

    For what I understand, this have some issues. Correct me if im wrong please.

    Supose that I have installed the binaries at /anyDirectory/node/ (Absolute Path)
    Then, I have /anyDirectory/node/bin/node, /anyDirectory/node/bin/npm and /anyDirectory/node/bin/npx
    So, I expect that executing /anyDirectory/node/bin/npm will use /anyDirectory/node/bin/node even if I have node in the PATH, cause I'm forcing an exact version of npm

    And, if I have node, npm and npx in the PATH, and I execute it like npm it will use whatever instance of node is in the PATH

    This is working on win OS

  4. richardlau commented on Nov 5, 2018

    @richardlau
    Member

    No you're correct. Your expected behavior is the way it used to work, but as I referenced the npm team asked us to change the behavior two and half years ago.

    cc @nodejs/npm

  5. devsnek commented on Nov 5, 2018

    @devsnek
    Member

    couldn't you ./bin/node ./bin/npm

  6. deinok commented on Nov 5, 2018

    @deinok
    Author

    @devsnek Yes, but then the process ID is node and not npm

  7. Trott commented on Nov 21, 2018

    @Trott
    Member

    I don't think we're likely to override the request of the npm folks on this one so I think the place to take this up is https://npm.community/. I'm going to close this, but feel free to comment (or re-open if GitHub permits) if there's a reason it should stay open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    npmIssues and PRs related to the npm client dependency or the npm registry.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions