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 you choose to install the node_modules in an absolute path like /usr/src/node_modules it looks like all current package manager don't support this fully.
The best would be if the package_json.manager.native_exec_command() would check if the executable exists. In case it doesn't exist fall back to an environment variable like PACKAGE_JSON_NODE_MODULES_BIN_PATH and check if the executable exists in this path else throw and error.
shakapacker up to version 7.x had support for SHAKAPACKER_NODE_MODULES_BIN_PATH which worked around those broken package managers. However shakapacker fully relies on package_json now. I think the workaround should be implemented in package_json.
Thanks!
The text was updated successfully, but these errors were encountered:
I'm not sure if this is something that package_json should be responsible for, as it's intended to be an abstraction over interacting with package.json regardless of package manager, whereas this is more generally "running a command" and potentially a bug in the package managers themselves.
More practically, my concern is that this increases the complexity - we either need to somehow figure out that the error was because the command didn't exist, or otherwise just assume that that's why it errored (which I think overall would be pretty unsafe to do), then we've got to check if the executable exists in the fallback path, which I believe on Linux is done with which but on Windows its with where so now we have to act differently depending on OS...
Overall this feels like something that could be better handled in Shakapacker, even at least just to start - given that, I'm going to post the rest of my thoughts on your Shakapacker issue, and we can continue talking there
If you choose to install the node_modules in an absolute path like
/usr/src/node_modules
it looks like all current package manager don't support this fully.See yarnpkg/yarn#7519 or pnpm/pnpm#9113
The best would be if the package_json.manager.native_exec_command() would check if the executable exists. In case it doesn't exist fall back to an environment variable like
PACKAGE_JSON_NODE_MODULES_BIN_PATH
and check if the executable exists in this path else throw and error.shakapacker up to version 7.x had support for
SHAKAPACKER_NODE_MODULES_BIN_PATH
which worked around those broken package managers. However shakapacker fully relies on package_json now. I think the workaround should be implemented in package_json.Thanks!
The text was updated successfully, but these errors were encountered: