-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE] nothrow option for async which #80
Comments
It seems that
has no console output as expected (ie. it's null) while
still throws:
|
@rlueder it looks like you might have multiple versions of can you trying reinstalling |
…rong version of `which` to be used, which caused R not to load on some configurations of Windows (#4311) <!-- Describe briefly what problem this pull request resolves, or what new feature it introduces. Include screenshots of any new or altered UI. Link to any GitHub issues but avoid "magic" keywords that will automatically close the issue. If there are any details about your approach that are unintuitive or you want to draw attention to, please describe them here. --> This PR addresses #4280. This issue was tracked down to the fact that the `positron-r` extension did not have an explicit `dependencies` entry for the `which` package, but it did have a `devDependencies` entry for `@types/which` (`"@types/which": "^3.0.0",`). As a result of this, the `positron-r/node_modules` folder contained `which` 2.0.2 (I believe) from: ``` mocha@^9.2.1: version "9.2.2" resolved "https://registry.npmjs.org/mocha/-/mocha-9.2.2.tgz" integrity sha512-L6XC3EdwT6YrIk0yXpavvLkn8h+EU+Y5UcCHKECyMbdUIxyMuZj4bX4U9e1nvnvUUvQVsV2VHQr5zLdcUkhW/g== dependencies: "@ungap/promise-all-settled" "1.1.2" ansi-colors "4.1.1" browser-stdout "1.3.1" chokidar "3.5.3" debug "4.3.3" diff "5.0.0" escape-string-regexp "4.0.0" find-up "5.0.0" glob "7.2.0" growl "1.10.5" he "1.2.0" js-yaml "4.1.0" log-symbols "4.1.0" minimatch "4.2.1" ms "2.1.3" nanoid "3.3.1" serialize-javascript "6.0.0" strip-json-comments "3.1.1" supports-color "8.1.1" which "2.0.2" workerpool "6.2.0" yargs "16.2.0" yargs-parser "20.2.4" yargs-unparser "2.0.0" ``` This version of `which` does not support the `nothrow` option for `async which`, which we rely on in this code fragment from `extensions/positron-r/src/provider.ts`: ``` const whichR = await which('R', { nothrow: true }) as string; ``` Because of this, on some configurations of Windows, an error was being thrown which caused R not to load. For background on this, see: npm/node-which#80. This was the exact same problem. ### QA Notes <!-- Add additional information for QA on how to validate the change, paying special attention to the level of risk, adjacent areas that could be affected by the change, and any important contextual information not present in the linked issues. -->
Somewhat self-explanatory, but this option exists for the which.sync and not which. It'd be nice to have it for both, and there doesn't seem to be anything inherently incompatible with the async implementation, just slightly messy.
The text was updated successfully, but these errors were encountered: