-
Notifications
You must be signed in to change notification settings - Fork 50
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
Fix NODE_PATH for legacy projects #235
Conversation
clinicjs#132 But ths still relates to current state clinicjs/node-clinic#148 So there might be changes done to fix NODE_PATH back, for legacy projects.
hmm it looks like the PR that supports spaces in option values in Node was only landed 6 days ago as a semver major change: nodejs/node#24065 is the real problem here that we're overwriting NODE_PATH? we should do similar concatenation there as we're doing with NODE_OPTIONS, i think, so both user paths and our internal paths are supported. |
Hi!
Yes, for me this was problem. Our legacy project is full of this NODE_PATH, and I was unable to run
I think this is not about this PR, cause it dropps NODE_PATH overrdes. |
Right, but we need our custom NODE_PATH for file paths with spaces in them 😄 We can support both cases if we properly concatenate them. I believe it's something like this: let nodePath = path.join(__dirname, 'injects')
if (process.env.NODE_PATH) {
if (process.platform === 'win32') {
nodePath += `;${process.env.NODE_PATH}`
} else {
nodePath += `:${process.env.NODE_PATH}`
}
} |
Thanks to @goto-bus-stop ! NODE_PATH works from both prospects.
@goto-bus-stop great thanks! It works! Related PR for bubbleprof #319. |
@goto-bus-stop it is strange, same changes for bubbleprof passed all tests.
seems checking on direct value of not more than 20ms is not so stable check and may depend on something else there, in a cloud. |
Yeah sorry, that test is flaky. You can ignore those failures. I have a PR to loosen the check in #237. Could you revert the changes to the test? Rest LGTM :D |
I did, thank you for explanations ^) |
Published as 📦 4.0.4 |
Seems this doesn't matter anymore
#132
But ths still relates to current state
clinicjs/node-clinic#148
So there might be changes done to fix NODE_PATH back, for legacy projects.