Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command not found #1863

Closed
danielmartinsen opened this issue Apr 30, 2020 · 39 comments
Closed

Command not found #1863

danielmartinsen opened this issue Apr 30, 2020 · 39 comments

Comments

@danielmartinsen
Copy link

Hello!

I have a problem with running the sanity command. I have installed the Sanity CLI with npm install -g @sanity/cli and when I write sanity init, I get this error message: bash: sanity: command not found

I am using npm version 6.14.4 and node version v12.16.2
I am not quite sure about wath sanity-version it is, but I think it would be the newest one.

@feedm3
Copy link

feedm3 commented Apr 30, 2020

Having the same issue here. Using yarn (1.22.4) + lerna (3.20.2) with yarn workspaces.

$ sanity start
/bin/sh: sanity: command not found

Edit: Fixed it. Was missing the @sanity/cli dependency in the package.json after I removed it from global dependencies.

@amiralitaheri
Copy link

@danielmartinsen try using npx sanity init

@kmelve
Copy link
Member

kmelve commented May 18, 2020

This may be caused by npm not being configured properly, that is, not being part of the path that your shell is looking through when you execute commands. It’s a bit hard to say without more information.

You should be able to use npx @sanity/cli init

@danielmartinsen
Copy link
Author

Thanks, that worked for me!

@hussamkhatib
Copy link

Had the same issue npx @sanity/cli init works for me.
is it a thing to bother about npm not being configured properly.

@aaronearl
Copy link

npx @sanity/cli init was the solution to my problem.

@aarontooyak
Copy link

npx sanity init worked for me!! amiralitaheri thank you!

@achinatuzi
Copy link

sudo npm @sanity/cli solved my problem

@raqibnur
Copy link

raqibnur commented Feb 26, 2022

npm run start
> sanity start
sh: sanity: command not found

npm run start gives error

@saikat100
Copy link

$ sanity start
bash: sanity: command not found

How can i solve it?

@Umayarz18
Copy link

@saikat100 @raqibnur
you can try npx sanity start or you can install the CLI using npm install -g @sanity/cli to try the command again. Hopefully, that helps 😄

@Birdland998
Copy link

npx @sanity/cli init

npx @sanity/cli start

try this it's work

@dexterous17
Copy link

npx @sanity/cli init worked for me

@ghost
Copy link

ghost commented Apr 23, 2022

npx @sanity/cli start it's work in my case go to your folder by cd command and start the cli

@socialrev-ui
Copy link

sanity init
npx sanity init
npx @sanity/cli init
None are working for me

I get this message: No such file or directory
Specifically with npx @sanity/cli init

Any suggestions will be helpful

@Kiranism
Copy link

npm i @sanity/core
This fixed my problem, just clear your existing node module folder and run @sanity/cli init and @sanity/core

@simonmedici
Copy link

I can run sanity with npx @sanity/cli init, but when installed I cant launch it. After the successful installation it says that i can run sanity with the command line sanity start . When doing so (double checked that I am in the right directory) it give me a "zsh: command not found: sanity".

Anyone an idea what that could be?

Screenshot 2022-05-04 at 21 50 02

@Kiranism
Copy link

Kiranism commented May 5, 2022

I can run sanity with npx @sanity/cli init, but when installed I cant launch it. After the successful installation it says that i can run sanity with the command line sanity start . When doing so (double checked that I am in the right directory) it give me a "zsh: command not found: sanity".

Anyone an idea what that could be?

Screenshot 2022-05-04 at 21 50 02

Follow this steps...
Delete your node module and dist folder first, then initialize with @sanity/cli init and try again(better to restart vscode) after init

@simonmedici
Copy link

hmm, so I did uninstall node and delete the dist folder. After that I tried to initialize sanity again with the command mentioned without any luck. (vsc was restarted).
Screenshot 2022-05-05 at 16 17 33

When this didnt work, I reinstalled node again to check if the version of node was the problem, after that i tried again. And got stuck at the same point as before the deletion. (that the command sanity start wasnt recognized)

@simonmedici
Copy link

I kinda suspect that the problem has to be something with a wrong path. I checked when reinstalling node again that the path selected is usr/local/bin. However when I check in the terminal with echo $PATH it shows me this: /Users/s****/opt/anaconda3/bin:/Users/s****/opt/anaconda3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
looks like a real mess :/

could that be the root for the problem? and if so, any suggestions how to untangle this mess?

@simonmedici
Copy link

When I run "npm run" in the terminal while in the directory of the sanity file. It responds me with the starting command "sanity start". However when I try to launch it, it give me back the "zsh: command not found: sanity" (see screenshot)
Screenshot 2022-05-05 at 18 26 55

I cant imagine why its not running, anyone a suggestion? Would be super appreciated as I am battling with this now for days :/.

@Kiranism
Copy link

Kiranism commented May 6, 2022

When I run "npm run" in the terminal while in the directory of the sanity file. It responds me with the starting command "sanity start". However when I try to launch it, it give me back the "zsh: command not found: sanity" (see screenshot) Screenshot 2022-05-05 at 18 26 55

I cant imagine why its not running, anyone a suggestion? Would be super appreciated as I am battling with this now for days :/.

Did you Uninstalled node??? I said to delete node module folder...just try again with @sanity/core and @sanity/cli init

@simonmedici
Copy link

hmm, did so but still stuck with the same command. "command not found: sanity"

@henrtz
Copy link

henrtz commented May 15, 2022

This may be caused by npm not being configured properly, that is, not being part of the path that your shell is looking through when you execute commands. It’s a bit hard to say without more information.

You should be able to use npx @sanity/cli init

Very helpful, Thanks....this worked for me

@deepakp2411
Copy link

Had the same issue npx @sanity/cli init works for me. is it a thing to bother about npm not being configured properly.

I am unable to fix it npx/npm both giving error

@timmeade
Copy link

timmeade commented Jun 14, 2022

was trying to run the new sanity to test and found myself here. nothing seems to work. Not good. Going to move on.

@ursula-paul
Copy link

Whenever i run sanity manage it says you are not a member of this project
or the project does not exist
but i created the project

@Benton-Michael
Copy link

After using npm to install sanity, the sanity init command was not found by zsh.

zsh: command not found: sanity

I used npx sanity init and this has solved the issue! Thank you!
Github msg Screen Shot 2022-08-03 at 6 26 00 PM

@samwpr
Copy link

samwpr commented Sep 12, 2022

I had a similar problem on my mac which was caused by not installing sanity globally.

Go to your terminal and enter:
sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}
Enter your password then install sanity globally
npm install -g ng
This should solve the issue and sanity commands should work too

@Takazudo
Copy link

same problem.

npx @sanity/cli init

worked for me.

@codetributor
Copy link

npx @sanity/cli init

npx sanity start

this worked for me.

@seymurallahyarli
Copy link

This may be caused by npm not being configured properly, that is, not being part of the path that your shell is looking through when you execute commands. It’s a bit hard to say without more information.

You should be able to use npx @sanity/cli init

Thanks Knut, it also worked for me!

@seymurallahyarli
Copy link

seymurallahyarli commented Oct 19, 2022

Also I had a problem while using "javascriptmastery" coupon I used this code line and worked.

npx @sanity/cli init --coupon javascriptmastery2022

@redolfosei
Copy link

Guys, when I do sanity start, this is the error I get. All the above commands are not helpful, they just restart the process and back to the error. Help!
Screen Shot 2022-12-25 at 12 05 05 AM

@codewisersahil
Copy link

npm run start
> sanity start
sh: sanity: command not found

npm run start gives error

use (npm run dev)
it will run ...

@codewisersahil
Copy link

sanity manage showing error

@codewisersahil
Copy link

Guys, when I do sanity start, this is the error I get. All the above commands are not helpful, they just restart the process and back to the error. Help! Screen Shot 2022-12-25 at 12 05 05 AM

use cmd (npm run dev)

@Folasayo-Samuel
Copy link

I solved this problem by running npm install -g @sanity/cli which was not included in the package.json file.

@fzchriha
Copy link

fzchriha commented Mar 9, 2023

Screen Shot 2023-03-09 at 11 40 54 AM

When re-initialized sanity, it prompted it me to run `npm run dev` and it worked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests