-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
"'node' is not recognized as an internal or external command" when using Yarn PnP on Windows #6683
Comments
The
Annotating Yarn's spawn wrapper showed that The size of stringified According to this page, the maximum size of ...which seems to line up with the findings above (once taking into account the additional characters added by There are also some other limits discussed here: ie: The additional directories on PATH push the original OS PATH entries past the point that gets truncated, such that Do all of those package directories need to be on PATH? I see entries that don't have binaries, that perhaps shouldn't be there? eg: |
These appear to come from here: yarn/src/util/execute-lifecycle-script.js Lines 213 to 221 in 7f41910
One possible approach would be to check for the existence of a |
Oh wow, thanks for the debug! Completely forgot about the I think on the short term I'll do the {
"scripts": {
"foo": "run babel --preset=env [...]"
}
} |
Hi @arcanis, Any movement on this? I'm hitting it. Would you be opposed to me submitting a PR for checking fot the existence of a I don't see an easy way around the resulting performnce hit (although it didn't seem that bad to me when I tested). Maybe we could only perform the checking if we're on Windows? |
Incidentally, I like your idea of having a Like you said, we would have to deprecate the old behaviour, rather than remove it, to avoid breaking existing projects. That means this bug would still exist - adding the Not sure what the alternative is... |
Absolutely not, please do! I think the perf impact should be negligible - this only affects scripts, which are supposed to be very few. It should be fine to do it on every platform for now. Do you think you can open the PR today? Otherwise I can give it a look as well.
Yep, the |
Yep - working on it now 😄 Just testing the changes... |
I must be missing something then - what benefit would the |
It would normalize how scripts and binaries are called across package managers (less so for binaries because for now the One particular example is this: {
"scripts": {
"build": "npm run foo && npm run bar",
"build:foo": "do-something foo",
"build:bar": "do-something bar"
}
} In the example above, Yarn will not be used to run Similarly, if you replace Having a |
Ah - I get it now. Makes sense. |
I've raised PR #6711 to 'fix' this. As mentioned in the PR, it really just makes this issue less likely to occur, rather than avoiding it entirely. |
## 1.13.0 - Implements a new `package.json` field: `peerDependenciesMeta` [6671](yarnpkg/yarn#6671) - [**Maël Nison**](https://twitter.com/arcanis) - Adds an `optional` settings to `peerDependenciesMeta` to silence missing peer dependency warnings [6671](yarnpkg/yarn#6671) - [**Maël Nison**](https://twitter.com/arcanis) - Implements `yarn policies set-version [range]`. Check [the documentation]() for usage & tips. [6673](yarnpkg/yarn#6673) - [**Maël Nison**](https://twitter.com/arcanis) - Fixes a resolution issue when a package had an invalid `main` entry [6682](yarnpkg/yarn#6682) - [**Maël Nison**](https://twitter.com/arcanis) - Decreases the size of the generated `$PATH` environment variable for a better Windows support [6683](yarnpkg/yarn#6683) - [**Rowan Lonsdale**](https://github.com/hWorblehat) - Fixes postinstall scripts for third-party packages when they were referencing a binary from their own dependencies [6712](yarnpkg/yarn#6712) - [**Maël Nison**](https://twitter.com/arcanis) - Fixes yarn audit exit code overflow [6748](yarnpkg/yarn#6748) - [**Andrey Vetlugin**](https://github.com/antrew) - Stops automatically unplugging packages with postinstall script when running under `--ignore-scripts` [6820](yarnpkg/yarn#6820) - [**Maël Nison**](https://twitter.com/arcanis) - Adds transparent support for the [`resolve`](https://github.com/browserify/resolve) package when using Plug'n'Play [6816](yarnpkg/yarn#6816) - [**Maël Nison**](https://twitter.com/arcanis) - Properly reports the error codes when the npm registry throws 500's [6817](yarnpkg/yarn#6817) - [**Maël Nison**](https://twitter.com/arcanis)
Closing as fixed in V2 |
I have the same problem. Even I set the path of node.js. However, it did not work. what can I do? Please guide me. |
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
When using Plug and Play on Windows, the
postinstall
command of the package fetch-mock fails to run, when certain other packages are listed in dependencies - however runs fine when those other unrelated dependencies are removed (?!).If the current behavior is a bug, please provide the steps to reproduce.
mkdir test && cd test
curl https://nightly.yarnpkg.com/yarn-1.13.0-20181114.2216.js -O
package.json
with the following contents:./yarn-1.13.0-20181114.2216.js
What is the expected behavior?
That the yarn install succeed when using plug and play mode.
I've reduced the size of the testcase
package.json
a fair amount - however removing any more of the dependencies above resulted in the issue no longer occurring. I'm presuming there's a race condition or other oddity occurring?Please mention your node.js, yarn and operating system version.
cc @arcanis
The text was updated successfully, but these errors were encountered: