fix: snap-detect-node
Context:
- https://github.com/nodejs/node/issues/37982#issuecomment-1248329844
- https://apify.slack.com/archives/CD0SF6KD4/p1741963523631019
First time hearing about "snap" distribution. Why exactly do you need it supported?
I will leave the actual review to @vladfrangu.
Anyway, some tests would be nice, I checked the thread on slack and even there you haven't provided any reproduction of some sort, only a link to a closed node issue.
First time hearing about "snap" distribution. Why exactly do you need it supported?
I will leave the actual review to @vladfrangu.
Anyway, some tests would be nice, I checked the thread on slack and even there you haven't provided any reproduction of some sort, only a link to a closed node issue.
I would like to support snap since I am using that personally.
Will add tests with snap node distribution. To reproduce just install node with snap (https://snapcraft.io/node) and try to use apify run which will fail without this patch.
@B4nan added node version check to test/utils.test.ts, since snap requires systemd which does not run in docker cicd checks with actual snap distribution could not be added. I tested it on my machine which uses the snap and previously apify run failed (it did not detect node) and with this patch installed it works as expected
Closing as I personally switched to fnm since there were other issues with the snap version, such as stdio handling, which, for example, breaks MCP stdio servers that rely on this. We can close this as it would cause additional overhead, and the snap distribution should fix this.