mattdesl / canvas-sketch

[beta] A framework for making generative artwork in JavaScript and the browser.
MIT License
5.02k stars 393 forks source link

Issue creating file sketch-01.js #179

Open Chomasteiger opened 1 year ago

Chomasteiger commented 1 year ago

When I install canvas I have this message: image

And then when I try to create the file "sketch-01.js" nothing happens, not even a message and If I go to the foulder, there is nothing inside. image

brunoimbrizi commented 1 year ago

@Chomasteiger I don't know what's causing the issue, but I can list some suggestions left by other users on what worked for them:

@alyona_furia wrote: "I used powershell as an admin and created a directory on C/users/etc and it worked."

@andresdeinnocentiis wrote: "in my case it was my antivirus who didn't allow the connection, but didn't show any warning. I don't know how I ended up trying disabling it, but it worked."

@bnecov wrote: "What worked for me was running the commands through VS Code`s terminal (also the solution suggested here)

Chomasteiger commented 1 year ago

I tried everything, I disable the antivirus and nothing happened, I used the app as an admin and also with the C directory and nothing. I dont know that much about this apps so I didnt tried with VS Code, I dont know even how to use it. What I tried is to use StackBlitz but when I copy the code it seems like its not working: image

raphaelrockus commented 1 year ago

Hi @Chomasteiger, I ran into your issue with Git Bash recently. As advised in the documentation, you can use "npx canvas-sketch-cli your_file_name.js --new --open" instead. I tested it in Git Bash and it worked fine.

Let me know if it helped.

Cheers from Belgium, Raphaël.

anakaren97 commented 1 year ago

Hello, I also had this issue and was able to fix it by doing what @alyona_furia wrote: "I used powershell as an admin and created a directory on C/users/etc and it worked." and then when I ran canvas-sketch sketch-01.js --new I got this error

"cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170."

so then I put this Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine which I found on https://stackoverflow.com/questions/54776324/powershell-bug-execution-of-scripts-is-disabled-on-this-system and that fixed the issue for me. I hope this helps.