Closed shakhvit closed 1 year ago
Thanks for the report.. I actually noticed this issue the other day myself.
Its actually good to know that you noticed this... since I wasn't sure if folks out there were using out embedded version of node outside of the emcc tool. Can I ask what you are using it for?
BTW, one temporary solution is to use the $EMSDK_NODE environment variable which we set to point to this copy of node.
@sbc100, thank you for your response. I've already developed a temporary workaround for this issue. The solution involves creating a wrapper script that guarantees emsdk_env.sh
is only sourced a single time.
Our project requires both emcc (for compiling C++ code into WASM) and Node.js (for operating certain backend network components). Given that emcc's toolkit already includes Node.js, it makes sense for us to utilize this bundled Node.js. It saves us from having to manage a separate Node.js installation. :)
I see. Interesting to know that some folks are taking advantage of our bundled version of node. My understanding was that most folks using node in production would actually want something a lot more recent (and more under their own control), but I stand corrected.
Another temporary option would be to install your own separate version of node. Even with the current bug emsdk_env
should never remove that version from you PATH
.
Description:
When I source the environment setup file
emsdk_env.sh
for emsdk (commit c2260b4f28f53b411032de0955a6fe6b6bcf3edd -- current main), node and npm binaries are correctly added to my path the first time. However, when I sourceemsdk_env.sh
again, node and npm are no longer accessible. Sourcing a third time brings them back, and this pattern continues with each subsequent sourcing.Steps to reproduce:
source ./emsdk_env.sh
.node -v
andnpm -v
.source ./emsdk_env.sh
.Environment:
I hope this issue can be addressed. Thank you for your time and help.