-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Error thrown when using the Gatsby CLI after install - "Error: Cannot find module 'detect-port'" #24325
Comments
This exact same thing happened to me as well. |
This is currently happening in my builds as well; using the |
This is a regression of #24065 Looks like it was an removed from the gatsby-recipes package.json, but it technically is used here in recipes.js of the cli so it should be then re-added to gatsby-cli's package.json. |
Same here. One quick fix is to install everything locally:
or install
|
Yep this solves the issue for me. Thanks mate |
Did it for me. Thanks |
I tried uninstall gatsby-cli globally and re-install version 2.20.29. The problem persisted. |
Thank you!! |
Should resolve build bug #24325 in gatsby-cli gatsbyjs/gatsby#24325
for me solved using npm |
for me not solved with yarn or npm |
thanks for all the solutions !! 🚀 |
None of the above solutions worked on my Mac. I just downgraded and I will wait for a new version before upgrading
Problem solved! |
For me solved , try this:
|
This worked thanks |
Sorry about that! Fixed in #24334 and released as |
for me solved. try this:
Thanks mate. |
Description
When I installed the gatsby CLI, I was unable to run it; it throws this exception in the command line:
This is only resolveable by globally installing
detect-port
, at which point everything is fine. Perhaps a missing dependency that wasn't included?Steps to reproduce
gatsby-cli
globally.gatsby -v
- any command will cause the failure it seems)Expected result
What should happen?
It should not throw
Actual result
It throws an exception saying that
detect-port
could not be found.Environment
System:
OS: macOS 10.15.4
CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 12.13.0 - ~/.nvm/versions/node/v12.13.0/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.4 - ~/.nvm/versions/node/v12.13.0/bin/npm
Languages:
Python: 2.7.17 - /usr/local/bin/python
Browsers:
Chrome: 81.0.4044.138
Edge: 81.0.416.72
Firefox: 74.0.1
Safari: 13.1
npmGlobalPackages:
gatsby-cli: 2.12.31
NB I had to do the above manual install of
detect-port
to get this to workThe text was updated successfully, but these errors were encountered: