Skip to content
This repository has been archived by the owner on Jul 15, 2022. It is now read-only.

Windows Setup Instructions #52

Open
ccoenen opened this issue Dec 19, 2021 · 2 comments
Open

Windows Setup Instructions #52

ccoenen opened this issue Dec 19, 2021 · 2 comments

Comments

@ccoenen
Copy link

ccoenen commented Dec 19, 2021

Hi everyone!

I just tried to install site.js, and I failed a couple of times in (possibly) interesting ways. I would like to post them here in case other failed in similar ways. And if this is a common thing, maybe the setup instructions should be altered slightly.

What eventually worked

  • Windows Terminal (as mentioned in the docs)
  • PowerShell (as mentioned in the docs)
  • starting the above with administrative privileges (missing from the docs, and without this, the installer appeared to work, but did not actually work!)
    start menu screenshot how to start with administrative privileges

When I did the above, site would work as a command. Setup would look like this:

terminal screenshot, contents posted below

plain text of the above image
PS C:\Users\username> iex(iwr -UseBasicParsing https://sitejs.org/install.txt).Content                                  

Installing Site.js using administrator privileges...

  • Downloading Site.js 20210819115729 (17.3.1/9522675)...
  • Extracting binary...
  • Installing binary...
  • Adding to system path...
  • Done!

PS C:\Users\username>

What did not work; things I tried before

via node.js

(also see #51)
setting up from Node.js gave me a slightly older 16.0.1, but the interesting part here is, that it cannot be run with site, but only with site.js.cms - at least in my configuration.

via install method in regular Powershell

This LOOKS like it runs fine, but it neither creates a C:\Program Files\site.js directory, nor does it work. Yes, I was asked for elevated permissions by my system, and of course I accepted them.

screenshot of regular powershell, plaint text posted below

plain text of the above image
PS C:\Users\username> iex(iwr -UseBasicParsing https://sitejs.org/install.txt).Content                                                                                                                                                           📡 Downloading Site.js 20210819115729 (17.3.1/9522675)…                                                                 
📦 Installing…                                                                                                          
🎉 Done!                                                                                                                                                                                                                                       

PS C:\Users\amenthes> site
site : Die Benennung "site" wurde nicht als Name eines Cmdlet, einer Funktion, einer Skriptdatei oder eines
ausführbaren Programms erkannt. Überprüfen Sie die Schreibweise des Namens, oder ob der Pfad korrekt ist (sofern
enthalten), und wiederholen Sie den Vorgang.
In Zeile:1 Zeichen:1

  • site
  • CategoryInfo : ObjectNotFound: (site:String) [], CommandNotFoundException
  • FullyQualifiedErrorId : CommandNotFoundException PS C:\Users\username> site.js
    site.js : Die Benennung "site.js" wurde nicht als Name eines Cmdlet, einer Funktion, einer Skriptdatei oder eines
    ausführbaren Programms erkannt. Überprüfen Sie die Schreibweise des Namens, oder ob der Pfad korrekt ist (sofern
    enthalten), und wiederholen Sie den Vorgang.
    In Zeile:1 Zeichen:1
  • site.js
  • CategoryInfo : ObjectNotFound: (site.js:String) [], CommandNotFoundException
  • FullyQualifiedErrorId : CommandNotFoundException PS C:\Users\username> site.js.cmd
    site.js.cmd : Die Benennung "site.js.cmd" wurde nicht als Name eines Cmdlet, einer Funktion, einer Skriptdatei oder
    eines ausführbaren Programms erkannt. Überprüfen Sie die Schreibweise des Namens, oder ob der Pfad korrekt ist (sofern
    enthalten), und wiederholen Sie den Vorgang.
    In Zeile:1 Zeichen:1
  • site.js.cmd
  • CategoryInfo : ObjectNotFound: (site.js.cmd:String) [], CommandNotFoundException
  • FullyQualifiedErrorId : CommandNotFoundException PS C:\Users\username>

(the same thing happens if one closes and reopens the powershell, I tried this because of possibly missing ENV-Vars)

via install method in Terminal WITHOUT ADMINISTRATIVE PRIVILEGES

This also looks like it ran fine, but did not create C:\Program Files\site.js either. Yes, in this case I also got asked for elevated permissions by my system, and of course I accepted them.

screenshot of Windows Terminal, full text transcribed below

plain text of the above image
Windows PowerShell
Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.

📡 Downloading Site.js 20210819115729 (17.3.1/9522675)…
📦 Installing…
🎉 Done!

PS C:\Users\username> site
site : Die Benennung "site" wurde nicht als Name eines Cmdlet, einer Funktion, einer Skriptdatei oder eines
ausführbaren Programms erkannt. Überprüfen Sie die Schreibweise des Namens, oder ob der Pfad korrekt ist (sofern
enthalten), und wiederholen Sie den Vorgang.
In Zeile:1 Zeichen:1

  • site
  •   + CategoryInfo          : ObjectNotFound: (site:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
    
@ccoenen
Copy link
Author

ccoenen commented Dec 19, 2021

It should also be noted that windows-included plain old regular powershell with administrative privileges seems to work, I cannot fully verify this, because now I've had a running site.js on my machine before, and it might just be that one instead.

Upside of Powershell only method: you only need the install script.
Downside of the Powershell only method: no emoji for you �.

screenshot from powershell with administrative privileges, full transcript below.

transcript of setup within powershell with administrative privileges
PS C:\Windows\system32> iex(iwr -UseBasicParsing https://sitejs.org/install.txt).Content                                

Installing Site.js using administrator privileges...

  • Downloading Site.js 20210819115729 (17.3.1/9522675)...

  • Extracting binary...

  • Installing binary...

  • Adding to system path...

  • Done!

PS C:\Windows\system32> site

[Windows hostname warning] Your primary DNS suffix is not set so we cannot calculate your hostname (full computer name). We are falling back to your computer name as retuned by os.hostname(). The app you’re running will most likely not work properly. To set your primary DNS suffix on Windows 10, go to Control Panel → System And Security → System → Change Settings link (next to Computer name) → [Change…] Button → [More…] Button → enter your domain name under Primary DNS suffix of this computer.

� ███████ ██ ████████ ███████  ██ ███████
██      ██    ██    ██       ██ ██     
███████ ██  ██  █████  ██ ███████
     ██ ██  ██  ██     ██ ██      ██
███████ ██  ██  ███████ ██  █████  ███████

     Created August 19th, 2021 at 11:57:29

     Version 20210819115729-17.3.1-9522675-windows/x64
     Node.js 12.16.2
     Hugo    0.78.0

     Base    https://sitejs.org/nexe/win32-x64-12.16.2
     Source  https://source.small-tech.org/site.js/app/-/tree/9522675

     ╔═══════════════════════════════════════════╗
     ║ Like this? Fund us!                       ║
     ║                                           ║
     ║ We’re a tiny, independent not-for-profit. ║
     ║ https://small-tech.org/fund-us            ║
     ╚═══════════════════════════════════════════╝

� ❨site.js❩ Using locally-trusted certificates.
� ❨https❩ Creating server at localhost with locally-trusted certificates.
� ❨auto-encrypt-localhost❩ Local development TLS certificate exists.
� ❨https❩ Created HTTPS server.
� ❨site.js❩ Watching for changes to dynamic and wildcard routes.
✨ ❨auto-encrypt-localhost❩ HTTP server is listening on port 80.
� ❨site.js❩ Serving current directory on https://localhost

� ❨site.js❩ For statistics, see https://localhost/aa390afda94d8af1fdb2c3dc4fa1f185

@ccoenen
Copy link
Author

ccoenen commented Dec 19, 2021

it should be noted that after successful setup, site then runs fine in any shell, including

  • cmd.exe
  • cmder with cmd.exe
  • powershell
  • cmder with powershell
  • Windows Terminal

site in cmd.exe

site in powershell

site in cmder in cmd.exe

site in cmder with powershell

site in windows terminal

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant