You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I do this from a Node REPL, this works fine, but trying to do it from a Yarn plugin I get the error:
Usage error: This plugin cannot access the package referenced via … which is neither a builtin, nor an exposed entry
The Node global require is apparently the Yarn plugin require, which is sandboxed to the modules that the plugin exposes. Requiring the custom profile path with miscUtils.dynamicRequire, in the plugin code, works as expected but how do I modify the global require (as used by dep-check) to not be the sandboxed version?
I have tried modifying Module.prototype.require (from the Node builtin module) but it doesn't seem to be called. Any help would be greatly appreciated.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm trying to call
capabilitiesFor
from @rnx-kit/dep-check, which ends up callingrequire
to resolve a custom profile path.If I do this from a Node REPL, this works fine, but trying to do it from a Yarn plugin I get the error:
The Node global
require
is apparently the Yarn plugin require, which is sandboxed to the modules that the plugin exposes. Requiring the custom profile path withmiscUtils.dynamicRequire
, in the plugin code, works as expected but how do I modify the globalrequire
(as used by dep-check) to not be the sandboxed version?I have tried modifying
Module.prototype.require
(from the Node builtinmodule
) but it doesn't seem to be called. Any help would be greatly appreciated.Beta Was this translation helpful? Give feedback.
All reactions