Closed lucasctnh closed 5 months ago
Ok, so just to add more information. I checked the code and the problem was that appPath
in the buildOriginDir
function had a regex match call which wasn't matching the dir path.
By removing the regex I've encountered another problem, the buildOriginDir
was returning a wrong path and the code could not find the templates folder. Here's the error:
node:fs:1527
handleErrorFromBinding(ctx);
^
Error: ENOENT: no such file or directory, scandir 'D:\Coding\portfolio-notehost\node_modules\notehost\dist\cli\notehost\templates'
at Object.readdirSync (node:fs:1527:3)
at Command.<anonymous> (file:///D:/Coding/portfolio-notehost/node_modules/notehost/dist/cli/index.js:139:27)
at Generator.next (<anonymous>)
at fulfilled (file:///D:/Coding/portfolio-notehost/node_modules/notehost/dist/cli/index.js:6:24)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
errno: -4058,
syscall: 'scandir',
code: 'ENOENT',
path: 'D:\\Coding\\portfolio-notehost\\node_modules\\notehost\\dist\\cli\\notehost\\templates'
}
Im not sure if this error was caused by me when I removed the regex match, but while I was trying the previous versions such as 1.0.9 and 1.0.8 I've encountered this same error. Adjusting the returning path manually fixed it and I was able to init
I can see the problem. This is an issue with Windows paths, which are not handled correctly by my code.
I've released a new version of notehost: 1.0.17, which should address this. Please run the init command again and lmk if you still experience crashes.
Thanks!
Since I'm not used to npm and npx I wonder if I am doing something wrong or if there's actually an error. This is what I receive whenever I try to init