mattdesl / canvas-sketch

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

canvas-sketch not compatible with node versions > 16.x #202

Closed LucasMERN closed 2 weeks ago

LucasMERN commented 3 weeks ago

I've tried it with 18 and 20. both will seem to install the CLI but the commands do not work. This is not a huge deal as anyone can use nvm to switch back and forth but you will not be able to create a new project with Astro, Next, Vite, and probably others without Node 18+.

mattdesl commented 3 weeks ago

Unusual as I’m typically using it from newer versions (on macOS). Are you on windows?

LucasMERN commented 3 weeks ago

Yes I am. I've seen it reported in 2 of the other issues that were open recently as well. https://github.com/mattdesl/canvas-sketch/issues/201#issuecomment-2265187355

mattdesl commented 3 weeks ago

I've just changed a feature that may help. Unfortunately I don't have access to Windows right now.

Can you try updating the CLI?

If you are using it globally:

npm i canvas-sketch-cli@1.15.0 --global

mkdir test-sketch
cd test-sketch
canvas-sketch sketch.js --new

Or if you are using it with npx:

mkdir test-sketch
cd test-sketch
npx canvas-sketch-cli@1.15.0 sketch.js --new

Or if you are using it with locally installed devDependency:

mkdir test-sketch
cd test-sketch
npm init -y

npm install canvas-sketch-cli@1.15.0 --save-dev
npx canvas-sketch sketch.js --new
LucasMERN commented 2 weeks ago

Works now. You can reclose this thread. I commented back on another thread.