small-tech / site.js

[Moved to Codeberg] Develop, test, and deploy your secure static or dynamic personal web site with zero configuration.
GNU Affero General Public License v3.0
474 stars 20 forks source link

Windows Setup Instructions #52

Open ccoenen opened 2 years ago

ccoenen commented 2 years ago

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

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 commented 2 years ago

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 commented 2 years ago

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

site in cmd.exe

site in powershell

site in cmder in cmd.exe

site in cmder with powershell

site in windows terminal