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
In yarn2, any module you attempt to require() must be declared as a dependency in your own package.json. This means when @node-rs/helper attempts to, for example, require('@swc/core-linux'), it fails, because @swc/core-linux is not a dependency of @node-rs/helper
Fortunately, I think the solution is simple. @node-rs/helper needs to accept the caller's require function as an argument. Then when trying to require modules, it will use the caller's require, which is able to resolve the caller's dependencies. This is what we want, since we want to be sure that the modules we load match the versions that the caller wants to use.
For backwards compatibility, this can be optional, but it will probably cause issues with yarn 2 until the callers are updated to pass in a require function.
The text was updated successfully, but these errors were encountered:
In yarn2, any module you attempt to
require()
must be declared as a dependency in your own package.json. This means when@node-rs/helper
attempts to, for example,require('@swc/core-linux')
, it fails, because@swc/core-linux
is not a dependency of@node-rs/helper
Fortunately, I think the solution is simple.
@node-rs/helper
needs to accept the caller'srequire
function as an argument. Then when trying torequire
modules, it will use the caller'srequire
, which is able to resolve the caller's dependencies. This is what we want, since we want to be sure that the modules we load match the versions that the caller wants to use.For backwards compatibility, this can be optional, but it will probably cause issues with yarn 2 until the callers are updated to pass in a
require
function.The text was updated successfully, but these errors were encountered: