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.

Fix resolveBin for windows

See original GitHub issue

resolveBin: https://github.com/kentcdodds/kcd-scripts/blob/bd3d6425598db7f25ee15f14238739abf5b28178/src/utils.js#L21-L44

It’s responsible for taking a module name (like eslint) and getting a path to the executable binary. If the path to the executable is the same as the one that’s in the $PATH environment variable (using which), then we can return the raw binary name itself and execute a script with that, otherwise we’ll return the full path so it’s executed with the full path (because it’s not available in $PATH presumably.

This is useful because if the user sees the script we run (which they do in some situations) then the script will be shorter.

It works on linux systems right now, but apparently the result of which.sync is to a file ending in .CMD and isn’t a symlink (so the realpathSync doesn’t resolve it to the binary path).

So we need to find a package that will do this for us (I already tried resolve-bin and it didn’t work the way I want it to) or fix this function up to make it work for windows as well as linux.

Anyone wanna help out?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
adamdharringtoncommented, May 13, 2019

nice one @kentcdodds !

1reaction
kentcdoddscommented, May 13, 2019

🎉 This issue has been resolved in version 1.3.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Read more comments on GitHub >

github_iconTop Results From Across the Web

thlorenz/resolve-bin
resolveBin (name, opts, cb). Resolves the full path to the bin file of a given package by inspecting the "bin" field in its...
Read more >
resolve-bin
Resolves the full path to the bin file of a given package by inspecting the "bin" field in its package.json.. Latest version: 1.0.1, ......
Read more >
How to Resolve bin/sh: 1: source not: found
In this article, we will discuss the causes of the error “bin/sh: 1: source not: found” and how to resolve it. A shell...
Read more >
Special characters in DaVinci Resolve bin names cause ...
There's a bug in the DaVinci Resolve 12 beta that can cause the contents of a bin to disappear if certain characters are...
Read more >
Npm Error - Windows NT - How to resolve
Turn off the real time protection of Windows Defender (or any other ... Antivirus software and work right. if a problem does not...
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