`site enable` error if no system-wide node available
alfonsomunozpomer opened this issue Β· comments
On a fresh Debian 10 machine, site enable
produces the following error:
$ site enable hello-world/ --skip-domain-reachability-check
π± ββββββββββββββββββββββββββββ ββββββββββ
ββββββββββββββββββββββββββββ ββββββββββ
βββββββββββ βββ ββββββ ββββββββββ
βββββββββββ βββ ββββββ ββ ββββββββββ
βββββββββββ βββ ββββββββββββββββββββββββββ
Created December 11th, 2020 at 16:40:25
Version 20201211164025-16.0.3-d712fe3-linux/x64
Node.js 12.16.2
Hugo 0.78.0
Base https://sitejs.org/nexe/linux-x64-12.16.2
Source https://source.small-tech.org/site.js/app/-/tree/d712fe3
βββββββββββββββββββββββββββββββββββββββββββββ
β Like this? Fund us! β
β β
β Weβre a tiny, independent not-for-profit. β
β https://small-tech.org/fund-us β
βββββββββββββββββββββββββββββββββββββββββββββ
π β¨site.jsβ© Linux: about to disable privileged ports so we can bind to ports < 1024.
β¨site.jsβ© For details, see: https://source.small-tech.org/site.js/app/-/issues/169
π§ β¨site.jsβ© Root privileges required.
β¨ β¨site.jsβ© Starting privileged processβ¦
π β¨site.jsβ© Linux: about to disable privileged ports so we can bind to ports < 1024.
β¨site.jsβ© For details, see: https://source.small-tech.org/site.js/app/-/issues/169
(node:4977) UnhandledPromiseRejectionWarning: Error: Command failed: which node
at checkExecSyncError (child_process.js:630:11)
at Object.execSync (child_process.js:666:15)
at /usr/local/bin/bin/commands/enable.js:79:46
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:4977) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:4977) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Iβm running it as a regular user in the sudo
group:
$ id
uid=1001(site) gid=1001(site) groups=1001(site),27(sudo)
Iβm using Node 12.16.2 to be in line with latest release:
$ which node
/home/site/.nvm/versions/node/v12.16.2/bin/node
$ node --version
v12.16.2
I fixed this by installing a system-wide Node. The error message was a bit puzzling, though, because node
is available to the user, although I understand that you need a system-wide node
for the service. I think this should be added to the Dependencies section.
Hi @alfonsomunozpomer, sorry about this, this was my mess up. I introduced a regression while fixing a different issue and the tests didnβt catch it as I have Node aliased system-wide to the nvm version (which the tests need).
This is now fixed in 160379e and included in 16.0.4+ (binary release 16.0.5).
Thanks again for reporting it.