-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
child_process.spawn produces empty string for various commands (node, npm, ncu) #13
Comments
Yeah .. so .. snaps and One option to try might be to I've also been forced to use Let me know if either of those options work for you. Unfortunately there are enough limitations that it's not unreasonable to suggest moving back to a native package whenever you need to do anything that moves outside of a happy path of usage (native addons add another layer of problems to the mix). |
Hi! We installed Node.js via snap store and tried to use |
Hey folks, so I recently ran into a similar issue with the combination of VSCode and Golang installed from Snaps, it felt a lot like this one and I'm pretty sure it's all Apparmor-related because of the funky process isolation Snaps are trying to do. Anyway, the workaround here has been working great for that particular issue: https://www.mail-archive.com/ubuntu-bugs@lists.ubuntu.com/msg5924452.html I haven't tried this to work around Node.js issues (mostly I'm not using it via Snap these days because of these problems!) but someone in this thread could give it a try and report back. |
I'm using Node-Red to launch a NodeJS instance and getting no output at all. I noticed this entry in
Possibly related? |
I’m closing this as there doesn’t seem to be any interest in reproducing or fixing this. |
This is still an issue and requires a fix. More details is on the the following issue nodejs/node#37982 and https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/1849753. A workaround is here nodejs/node#37982 (comment). |
(initially reported in nodesource/distributions#843)
I switched from the PPA binary (https://github.com/nodesource/distributions/blob/master/README.md#debinstall) to the snap binary (https://snapcraft.io/node). This started to break the
ncu -g
command. Originally, I opened an issue with npm-check-updates, but it doesn’t seem to be an issue on their end (for reference: raineorshine/npm-check-updates#536).Only with the snap binary do I get the following error:
The command that is executed with
child_process.spawn
isnpm ls --global --depth=0 --json
which produces the correct JSON with both the PPA and the snap binary when executed directly from the terminal.Steps to reproduce:
Create a reproduction.js file containing the following code and run
node reproduction.js
withnode
being a Node.js binary from a Snap source (reproduces with all versions fromv12
tov14
at least).To switch around the Node binary on Ubuntu:
Uninstall Node.
Install Node via Snap.
Verify that Snap’s Node is used (i.e. on my system, the binary is reported to be in
/snap/bin/node
when runningwhich node
).Run npm-check-updates with the global flag.
Remove Node via Snap.
Install Node via apt.
The text was updated successfully, but these errors were encountered: