Closed mmomtchev closed 4 months ago
There is also an issue on the arborist
side: https://github.com/npm/cli/issues/4291
Maybe a very first very simple step would be to emit a warning about a require.resolve
and to leave it as-is - or at least make an option to force this behavior.
Alas, there is no simple solution in ncc
, this should be fixed in @npmcli/arborist
.
Steps to reproduce:
then:
Result:
The problem:
arborist
contains the following construct:It is used to retrieve the path from the internally installed
node-gyp
and to add it to thePATH
. What is remarkable in this case is that even if this statement fails (it will for the transpiled bundle - there won't be a local dependencynode-gyp
), this will still work globally if the environment hasnode-gyp
.When using
rollup
, it is possible to make this to work without too much fiddling. I haven't found any way to make it work withncc
.