jaysylvester / citizen

Node.js MVC web application framework. Includes routing, serving, caching, session management, and other helpful tools.
MIT License
100 stars 7 forks source link

Unable to start the scaffold in Windows #133

Open ssenthilanand opened 3 days ago

ssenthilanand commented 3 days ago

I am not able to start the scaffold when running in native Windows. Get the same error using cmd.exe, Powershell as well as Git Bash. However it works on Debian running under WSL. Looks like a path handling issue.

Transcript of the session:

~ ❯ cd .\projects\citizen\

~\projects\citizen ❯ cd .\myapp\

projects\citizen\myapp via  v20.18.0 ❯ node node_modules/citizen/util/scaffold skeleton node:fs:573 return binding.open( ^

Error: ENOENT: no such file or directory, open 'C:\C:\Users\senan\projects\citizen\myapp\node_modules\citizen\util\templates\hooks\application.js' at Object.openSync (node:fs:573:18) at Object.readFileSync (node:fs:452:35) at Command. (file:///C:/Users/senan/projects/citizen/myapp/node_modules/citizen/util/scaffold.js:95:28) at Command.listener [as _actionHandler] (C:\Users\senan\projects\citizen\myapp\node_modules\commander\lib\command.js:542:17) at C:\Users\senan\projects\citizen\myapp\node_modules\commander\lib\command.js:1502:14 at Command._chainOrCall (C:\Users\senan\projects\citizen\myapp\node_modules\commander\lib\command.js:1386:12) at Command._parseCommand (C:\Users\senan\projects\citizen\myapp\node_modules\commander\lib\command.js:1501:27) at C:\Users\senan\projects\citizen\myapp\node_modules\commander\lib\command.js:1265:27 at Command._chainOrCall (C:\Users\senan\projects\citizen\myapp\node_modules\commander\lib\command.js:1386:12) at Command._dispatchSubcommand (C:\Users\senan\projects\citizen\myapp\node_modules\commander\lib\command.js:1261:25) { errno: -4058, code: 'ENOENT', syscall: 'open', path: 'C:\C:\Users\senan\projects\citizen\myapp\node_modules\citizen\util\templates\hooks\application.js' }

Node.js v20.18.0

projects\citizen\myapp via  v20.18.0 ❯

jaysylvester commented 2 days ago

I admit I haven't tested it in native Windows, only Debian and Mac. This path is obviously wrong due to the double drive letter:

C:\C:\Users\senan\projects\citizen\myapp\node_modules\citizen\util\templates\hooks\application.js

It looks like the scaffold is running, just not finding the file due to the bad path, so maybe I need to tweak how I'm deriving the file path so it works in Windows.