Whenever I install any gatsby plugins or typography files, and then attempt to run gatsby develop
, I am thrown an error sying that 'react' can't be found. Example:
I create a new gatsby site using gatsby new example-site https://github.com/gatsbyjs/gatsby-starter-hello-world
I install the gatsby-plugin-sass using npm install --save node-sass gatsby-plugin-sass
I follow the instructions on the plugin page, adding the plugin to my gatsby-config.js file.
When I now attempt to run gatsby develop
I receive the following errors:
ERROR
There was a problem loading the local develop command. Gatsby may not be installed. Perhaps you need to run "npm install"? Cannot find module 'react'
Error: Cannot find module 'react'
As well as a list of files that the errors are being thrown in, most of them in internal files.
Clearly I have the Gatsby-cli installed, as well as react. I'm also receiving a ton of warnings about deprecated related to core-js and optional dependencies not being installed.
In my research, I have found people saying that using yarn instead of npm solves the issue, but with Gatsby being as large of a project as it is, and with the documentation itself saying to use npm, that doesn't seem like a solution but rather a work around. Is there any other info on this that I just can't seem to find?
npm install
in your project directory? Any errors there? (also note thatgatsby-cli
is not the same as thegatsby
dependency. You need the second to run a Gatsby project) – Robin Métralgatsby -v
I am shown both a cli version and a gatsby version as well. Thanks for the clarification. – Josh Bangle