`npm bin` is removed in npm v9 · Issue #23 · codesuki/add-node-modules-path · GitHub
Skip to content

npm bin is removed in npm v9 #23

Open

Description

@ybiquitous

Hello. I notice the npm bin command will be removed in npm@9.0.0 when reading the release note of npm@9.0.0-pre.0.

This elisp package heavily depends on npm bin, so I worry the package will require some action in the future. Although, I have no good idea right now.

I hope this sharing will be of some help.

See also:

Activity

  1. ybiquitous commented on Oct 25, 2022

    @ybiquitous
    ContributorAuthor

    npm v9 has been released and will be latest on Nov 9, according to the announcement.

  2. ybiquitous commented on Oct 25, 2022

    @ybiquitous
    ContributorAuthor

    I've found the following workaround via npm exec, though the way may be a bit hacky:

    (setq add-node-modules-path-command "npm exec --package=npm@8 -- npm bin")
  3. changed the title [-]`npm bin` will be removed in npm@9.0.0[/-] [+]`npm bin` is removed in npm@9.0.0[/+] on Oct 25, 2022
  4. changed the title [-]`npm bin` is removed in npm@9.0.0[/-] [+]`npm bin` is removed in npm v9[/+] on Oct 25, 2022
  5. codesuki commented on Nov 14, 2022

    @codesuki
    Owner

    Hey! Thanks for sharing. I didn't notice this issue at all, sorry.

    That is unfortunate that they removed this command.
    Before using npm bin we used to recursively look for a node_modules folder, but that also had issues.

    Maybe until we find something people can at least refer to your workaround.

  6. ybiquitous commented on Nov 14, 2022

    @ybiquitous
    ContributorAuthor

    The following workaround using npm root may be better:

    (setq add-node-modules-path-command "echo \"$(npm root)/.bin\"")

    EDIT: Though this is still tricky.

  7. hyakt commented on Jun 16, 2023

    @hyakt

    I used to be grateful for the workaround at #23 (comment), but now it seems that I need to set the following I have to configure it as follows.

    (setq add-node-modules-path-command '("echo \"$(npm root)/.bin\"")))
  8. zach-delong commented on Oct 28, 2023

    @zach-delong

    I have also been using the workaround @hyakt mentions and that works fine for me on Linux. It didn’t work well on Windows, though (because the default shell is CMD still). It would probably make sense to use some elisp to concatenation in the .bin.

  9. added a commit that references this issue on Oct 1, 2024
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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions