Open Horadrim opened 1 month ago
Hmm, I cannot seem to reproduce. I'm on mac, using chrome, deleted all my srcbook files (so, clean slate) and then ran:
npm i -g srcbook
srcbook start
This installed and booted srcbook@0.0.6
.
I created a srcbook, entered a title, no crash. Then I tried writing code (without installing deps), no crash.
@Horadrim Hmm, me to, I am on Ubuntu, using brave, working fine, not able to reproduce this issue
I am getting the same error on Windows. I dug into it a bit and found its because of the difference in how windows handles the spawn call. it looks like it needs the option "shell" set to true for windows to be able to run tsserver:
const child = spawn('npx', ['tsserver'], {
cwd: options.cwd,
shell: process.platform == 'win32',
});
unfortunately it seems like there may still be other issues as am still unable to successfully run typescript cell code even after that change. But hopefully this gives you all a good starting point to supporting windows as well if you decide to do so :)
I forgot to mention that I'm using windows 11. I guess since the other guys can't reproduce it on Linux and Mac, seems to be a Windows only issue indeed.
@Cam-Bread Windows TS code is under the work it's just some extra work with windows white spacing in validators and a few places left not using path.join()
has this been resolved? im having the same issues on Windows
npx srcbook@latest start
Srcbook
Serving static files (React app)...
Creating WebSocket server...
Initialization complete
srcbook@0.0.14 running at http://localhost:2150
Error: spawn npm ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:286:19)
at onErrorNT (node:internal/child_process:484:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
errno: -4058,
code: 'ENOENT',
syscall: 'spawn npm',
path: 'npm',
spawnargs: [ 'install', '--include=dev' ]
}
node:internal/process/promises:391
triggerUncaughtException(err, true / fromPromise /);
^
Unfortunately windows support is not ready yet. We're working hard to ship a hosted version right now which will make Srcbook usable online making these platform issues less of a pain.
Steps to reproduce:
Console output:
` Srcbook
Serving static files (React app)... Creating WebSocket server... Initialization complete srcbook@0.0.6 running at http://localhost:2150 node:events:497 throw er; // Unhandled 'error' event ^
Error: spawn npx ENOENT at ChildProcess._handle.onexit (node:internal/child_process:286:19) at onErrorNT (node:internal/child_process:484:16) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) Emitted 'error' event on ChildProcess instance at: at ChildProcess._handle.onexit (node:internal/child_process:292:12) at onErrorNT (node:internal/child_process:484:16) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { errno: -4058, code: 'ENOENT', syscall: 'spawn npx', path: 'npx', spawnargs: [ 'tsserver' ] }
Node.js v20.16.0 `