small-tech / site.js

[Moved to Codeberg] Develop, test, and deploy your secure static or dynamic personal web site with zero configuration.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`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.