question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug]: "command not found" for node module binaries from npm scripts

See original GitHub issue

Self-service

  • I’d be willing to implement a fix

Describe the bug

I’m attempting to upgrade a project from Yarn 1 to 2, which was rather easy. The PR is here: https://github.com/milesj/packemon/pull/75

However, many of my NPM scripts fail with a “command not found: beemo” when attempting to run. The scripts look like "lint": "beemo eslint", and the binary does exist (screenshot below).

Screen Shot 2021-07-10 at 6 54 33 PM

I tried yarn beemo and yarn run beemo, but those also fail.

 ~/Projects/packemon   yarn2 ±  yarn beemo
Usage Error: Couldn't find a script named "beemo".

$ yarn run [--inspect] [--inspect-brk] <scriptName> ...

~/Projects/packemon   yarn2 ±  yarn run beemo
Usage Error: Couldn't find a script named "beemo".

$ yarn run [--inspect] [--inspect-brk] <scriptName> ...

I’m not sure what to do here. I haven’t seen anything about this in the docs…

To reproduce

This PR: https://github.com/milesj/packemon/pull/75

Environment

System: OS: macOS 11.2.3 CPU: (12) x64 Intel® Core™ i7-9750H CPU @ 2.60GHz Binaries: Node: 16.4.0 - /private/var/folders/3_/4gw29kj089fh24k68n7gxx80000gn/T/xfs-febfc55f/node Yarn: 2.4.2 - /private/var/folders/3/_4gw29kj089fh24k68n7gxx80000gn/T/xfs-febfc55f/yarn npm: 7.18.1 - ~/.nvm/versions/node/v16.4.0/bin/npm

Additional context

Fails locally and in GitHub actions.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
milesjcommented, Jul 11, 2021

@merceyz The rationale makes sense, but having the binary in the .bin folder, but not actually work is extremely confusing.

Is this also noted in the docs somewhere? Because this is a rather controversial change.

0reactions
niieanicommented, Sep 6, 2021

If anyone stumbled upon this, a workaround here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use executables from a package installed locally in ...
From npm@5.2.0, npm ships with npx package which lets you run commands from a local ... As you have found out, any locally...
Read more >
NPM Script Error: <dependency> command not found - Medium
After upgrading Nodejs and NPM via nvm install --lts , I deleted the project's node_modules subdirectory and executed npm install once again.
Read more >
npm-run-script
Description. This runs an arbitrary command from a package's "scripts" object. If no "command" is provided, it will list the available scripts.
Read more >
How Do I Fix Bash npm Not Found? - Linux Hint
Our very first solution involves re-installing Node.js and all of its components from scratch. A corrupted installation or configuration can cause such an...
Read more >
Npm install command failing with message "could not find ...
When I run the npm install command, npm starts downloading the ... VS not looking for VS2013 as it is only supported up...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found