Discussion of errors when running Sanity start command

24 replies
Last updated: Jul 6, 2021
Hey guys! When I run
sanity start
it keeps throwing me this error. Where am I doing wrong?
Jul 5, 2021, 10:29 AM
Whenever I get some error with sanity/base, I run sanity install and try again. Please try that and see if it works
Jul 5, 2021, 10:45 AM
Ahh I see, It kinda worked but it omitted an other error
sanity start
      throw er; // Unhandled 'error' event

Error: listen EADDRINUSE: address already in use
    at Server.setupListenHandle [as _listen2] (net.js:1318:16)
    at listenInCluster (net.js:1366:12)
    at GetAddrInfoReqWrap.doListen (net.js:1503:7)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:69:8)
Emitted 'error' event on Server instance at:
    at emitErrorNT (net.js:1345:8)
    at processTicksAndRejections (internal/process/task_queues.js:82:21) {
  code: 'EADDRINUSE',
  errno: -48,
  syscall: 'listen',
  address: '',
  port: 3333
Jul 5, 2021, 10:57 AM
Because you have another instance of Sanity studio running. Please close that, and run this once again. Hope that helps. Happy coding
Jul 5, 2021, 10:58 AM
Yeah fair enough. When I terminated the other one and when I run sanity start again it threw the same sanity/base error again now. I'm kinda breaking my head here. Just going in circles and circles smh -_-. I appreciate you helping me tho.
Jul 5, 2021, 11:03 AM
It seems like the errors are in your node_modules folder. Please try npm install as well (you can delete node_modules before installation if you'd like)
Jul 5, 2021, 11:08 AM
Yeah I did deleted node_modules and tried
npm install.
And then I ran sanity start in the sanity dierectory, still throwing me the same error
Jul 5, 2021, 11:15 AM
user T
! Is it still throwing the
cannot resolve...
Jul 5, 2021, 2:49 PM
Yeah It's throwing
user P
Jul 5, 2021, 2:50 PM
What does your
file look like?
Jul 5, 2021, 2:50 PM
This is usually resolved with removing node_modules and running
npm install
Jul 5, 2021, 2:51 PM
Tried removing node_modules as well
Jul 5, 2021, 2:52 PM
Still it's doens't work
Jul 5, 2021, 2:53 PM
I just don't understand what the complication is here
Jul 5, 2021, 2:53 PM
Which node version are you on?
node --version
Jul 5, 2021, 2:53 PM
Jul 5, 2021, 2:54 PM
Hm. That is very weird, indeed. What do you have in your package.json?
Jul 5, 2021, 3:03 PM
Perhaps it is
Jul 5, 2021, 3:07 PM
user M
, I got rid of the files and tried
npm install
sanity install
. It kept throwing me the same error i.e
Jul 5, 2021, 6:59 PM
Could you share the dependencies in your studio root folder's
? So not the
Jul 5, 2021, 7:04 PM
There you go
Jul 5, 2021, 7:09 PM
I got it worked certainly !I was kind of skeptical about it, but it surprised me! When I got rid of
then for some reason my node was uninstalled from my mac. So I had to install Node using
brew install node
in my terminal. And then I tried
npm install
in my project directory.And I also had to run the command ``npm install -g @sanity/cli` followed by commands
sanity install
sanity start
and it worked.I believe it was some kind of complication with Node. I don't know for sure tho just assuming.

Anyways I appreciate you guys helping me patiently!

user A
user M
user A
Jul 6, 2021, 4:36 AM
user T
I just faced similar issue, and I tried all the node related stuff. Actually the was caused by one of Sanity plugins. I had to reinstall the plugin and restart the server to get it working.
Jul 6, 2021, 4:39 AM
Happy to hear it!
Jul 6, 2021, 4:45 AM
user G
May be you're not wrong .Anyways Happy coding : )
Jul 6, 2021, 5:23 AM

Sanity– build remarkable experiences at scale

The Sanity Composable Content Cloud is the headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?

Categorized in