So I downloaded node like it said then download the choice files and extracted them like it said but when I go to start server I keep getting this error I tried to change the name to what it was looking for and it still can’t find it
Yes I did that that’s where I renamed the txt one I believe I followed that path and renamed my file to ${gameDir} it won’t let me post pictures
Ah, yeah, you can’t post pictures till you reach a higher rank on the forum, should be rather quick if you engage with posts regularly, though.
Just to make sure, which files did you rename?
This issue occurred to me also. The current github link for choicescript is broken (I made a post about this and they never fixed it ig).
- Go to serve.js in the choicescript-main folder
Replace this part of the code:
const requestHandler = (request, response) => {
//console.log(request.url);
const requestUrl = new URL(request.url, base);
const requestPath = requestUrl.pathname;
let requestFile = path.normalize(`${dir}/${requestPath}`);
if (!requestFile.startsWith(dir)) {
response.statusCode = 400;
response.end();
return;
} else if (requestFile.endsWith(path.sep)) {
requestFile += 'index.html';
} else if (requestFile.endsWith('mygame.js')) {
const gameDir = path.basename(path.dirname(requestFile));
const mygame = child_process.execSync('node mygamegenerator.js ${gameDir}', {encoding: 'utf8'});
fs.writeFileSync(`${dir}/web/${gameDir}/mygame.js`, mygame, 'utf8');
}
With this:
const requestHandler = (request, response) => {
//console.log(request.url);
const requestUrl = new URL(request.url, base);
const requestPath = requestUrl.pathname;
let requestFile = path.normalize(`${dir}/${requestPath}`);
if (!requestFile.startsWith(dir)) {
response.statusCode = 400;
response.end();
return;
} else if (requestFile.endsWith(path.sep)) {
requestFile += 'index.html';
}
Or just delete the 2nd else if statement.
If anyone knows the people that run the github… Please tell them to see this or else the forum is going to keep getting these posts.
you ought to send a mail to support.
Also I am not 100% certain if the erroneous code hasn’t something to do with the new app
Thank you I’ll try this when I get home



