Closed te-lei closed 2 years ago
Hey @te-lei, some of those errors makes me think that npm or node have not been installed correctly, if you are not even able to set npm config without generating an error. If you haven't tried it, I would recommend re-downloading and re-installing the latest version from Nodejs site, which comes with npm.
The zsh: command not found: canvas-sketch
appears to be something to do with the PATH to npm global directory not being recognized by your terminal.
For now, I'd recommend maybe trying the local installation steps outlined here:
https://github.com/mattdesl/canvas-sketch/issues/125#issuecomment-1003946650
If you do happen to set up your permissions + config correctly and are able to install globally, also make sure you have your PATH including the folder you've set it to. I have a file ~/.bash_profile
and ensure the following line is present in it, so that it loads that path into the env var each time my terminal is run. But this file may be different depending on your shell (like ~/.zshrc
).
export PATH=~/.npm-global/bin:$PATH
I have similar issue zsh: command not found: canvas-sketch despite the fact that I went to my folder in order to create a new file so the question is whether is a chance to fix this or there is only one option re-installing?
Hey @AnnaMilena I still am yet to get a solution. Are you also running on Monterey?
hey , Yes I do.
@AnnaMilena Yeah I think that's what made our terminal shell default to zsh instead of bash and mess something up. I'll let you know if it works but even after reinstalling I can't figure it out. Did you try the same?
I gonna re-install again and see what happens . I configured and fixed from the root Aministrator npm global used by profile. I used these commands, but it doesnt work in my case . plus I am a novice , I know general Linux commands . I had this issue but I read somewhere that this is not a serious issue and code should work..
@AnnaMilena @te-lei Have you tried to install canvas-sketch locally? You'd install it in your project directory with npm install canvas-sketch-cli --save-dev
and you'd have to run canvas-sketch with npx (npx canvas-sketch my-sketch.js --open
, for example).
Thanks, defenitely I will try it. I hope it will work!
Closing this, see this comment for further details: https://github.com/mattdesl/canvas-sketch/issues/96#issuecomment-1231548822
Have been troubleshooting many different options such as using sudo and root but still no luck. When I try to change the npm's directory I get the following:
Also, not sure why I don't have a bash, but only zsh and this is the directory in my /user:
The path is this: