Skip to content

Fix NODE_PATH for legacy projects#235

Merged
goto-bus-stop merged 8 commits intoclinicjs:masterfrom
wentout:master
Apr 25, 2019
Merged

Fix NODE_PATH for legacy projects#235
goto-bus-stop merged 8 commits intoclinicjs:masterfrom
wentout:master

Conversation

@wentout
Copy link
Copy Markdown
Contributor

@wentout wentout commented Apr 11, 2019

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.

wentout added 3 commits April 11, 2019 18:21
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.
@goto-bus-stop
Copy link
Copy Markdown
Contributor

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.

@wentout
Copy link
Copy Markdown
Contributor Author

wentout commented Apr 23, 2019

Hi!

is the real problem here that we're overwriting NODE_PATH?

Yes, for me this was problem. Our legacy project is full of this NODE_PATH, and I was unable to run doctor on it. So the problem is overriding.

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.

I think this is not about this PR, cause it dropps NODE_PATH overrdes.

@goto-bus-stop
Copy link
Copy Markdown
Contributor

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.
@wentout
Copy link
Copy Markdown
Contributor Author

wentout commented Apr 23, 2019

Right ... custom NODE_PATH .. something like this ...

@goto-bus-stop great thanks! It works!

Related PR for bubbleprof #319.

@wentout
Copy link
Copy Markdown
Contributor Author

wentout commented Apr 23, 2019

@goto-bus-stop it is strange, same changes for bubbleprof passed all tests.
And this test fails for sampling interval checker. Moreover, it has unstable behaviour, it fails only on Mac bundles and may fail or not. As I logged there for

test('cmd - collect - data files have content ...

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.

@goto-bus-stop
Copy link
Copy Markdown
Contributor

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

@wentout
Copy link
Copy Markdown
Contributor Author

wentout commented Apr 25, 2019

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 ^)

@goto-bus-stop goto-bus-stop merged commit ce6dd65 into clinicjs:master Apr 25, 2019
@goto-bus-stop
Copy link
Copy Markdown
Contributor

Published as 📦 4.0.4
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants