简体   繁体   中英

“gatsby-plugin-sharp” plugin Couldn't be found when gatsby develop command is ran

Got a new pc and cloned my project from GitHub, then run npm install but then it installed with lots of errors, so now I ran gatsby develop and got the error messages below. please assist me

ERROR #10226 CONFIG

Couldn't find the "gatsby-plugin-sharp" plugin declared in "C:\\Users\\Administrator\\Desktop\\Projects\\IamJude\\gatsby-config.js".

Tried looking for a local plugin in C:\\Users\\Administrator\\Desktop\\Projects\\IamJude\\plugins\\gatsby-plugin-sharp.

Tried looking for an installed package in the following paths:

  • C:\\Users\\Administrator\\Desktop\\Projects\\IamJude\\node_modules\\gatsby\\dist\\bootstrap\\load-themes\\node_modules\\gatsby-plugin-sharp
  • C:\\Users\\Administrator\\Desktop\\Projects\\IamJude\\node_modules\\gatsby\\dist\\bootstrap\\node_modules\\gatsby-plugin-sharp
  • C:\\Users\\Administrator\\Desktop\\Projects\\IamJude\\node_modules\\gatsby\\dist\\node_modules\\gatsby-plugin-sharp
  • C:\\Users\\Administrator\\Desktop\\Projects\\IamJude\\node_modules\\gatsby\\node_modules\\gatsby-plugin-sharp
  • C:\\Users\\Administrator\\Desktop\\Projects\\IamJude\\node_modules\\gatsby-plugin-sharp
  • C:\\Users\\Administrator\\Desktop\\Projects\\node_modules\\gatsby-plugin-sharp
  • C:\\Users\\Administrator\\Desktop\\node_modules\\gatsby-plugin-sharp
  • C:\\Users\\Administrator\\node_modules\\gatsby-plugin-sharp
  • C:\\Users\\node_modules\\gatsby-plugin-sharp
  • C:\\node_modules\\gatsby-plugin-sharp

not finished open and validate gatsby-configs - 1.329s

ERROR

The above error occurred in the component: in CLI (created by ConnectedCLI) in ConnectedCLI in StoreStateProvider in App

React will try to recreate this component tree from scratch using the error boundary you provided, App.

ERROR

Warning: App: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.

C:\\Users\\Administrator\\AppData\\Roaming\\npm\\node_modules\\gatsby-cli\\node_modules\\yoga-layout-prebuilt\\yoga-layout\\build\\Release\\nbind.js:53
throw ex; ^

TypeError: Cannot read property 'activities' of undefined at getGlobalStatus (C:\\Users\\Administrator\\AppData\\Roaming\\npm\\node_modules\\gatsby-cli\\lib\\reporter\\redux\\utils.js:25:54) at createPendingActivity (C:\\Users\\Administrator\\AppData\\Roaming\\npm\\node_modules\\gatsby-cli\\lib\\reporter\\redux\\internal-actions.js:114:51)
at C:\\Users\\Administrator\\AppData\\Roaming\\npm\\node_modules\\gatsby-cli\\node_modules\\redux\\lib\\redux.js:483:35 at prematureEnd (C:\\Users\\Administrator\\AppData\\Roaming\\npm\\node_modules\\gatsby-cli\\lib\\reporter\\catch-exit-signals.js:39:38) at Reporter.panic (C:\\Users\\Administrator\\AppData\\Roaming\\npm\\node_modules\\gatsby-cli\\lib\\reporter\\reporter.js:72:42) at process. (C:\\Users\\Administrator\\AppData\\Roaming\\npm\\node_modules\\gatsby-cli\\lib\\index.js:79:21) at process.emit (events.js:327:22) at processEmit (C:\\Users\\Administrator\\AppData\\Roaming\\npm\\node_modules\\gatsby-cli\\node_modules\\signal-exit\\index.js:161:32) at process.emit (C:\\Users\\Administrator\\AppData\\Roaming\\npm\\node_modules\\gatsby-cli\\node_modules@turist\\fetch\\dist\\sourcemap-register.js:926:21) at processEmit [as emit] (C:\\Users\\Administrator\\Desktop\\Projects\\IamJude\\node_modules\\gatsby\\node_modules\\gatsby-cli\\node_modules\\signal-exit\\index.js:161:32) at processPromiseRejections (internal/process/promises.js:209:33) at processTicksAndRejections (internal/process/task_queues.js:98:32)

What is the contents of your package.json?

Do you having gatsby-plugin-sharp installed?

Maybe try npm install --save gatsby-plugin-sharp

In Windows, you may need to make add a few extra packages to make the project run. First of all, I will try to add manually the gatsby-plugin-sharp by:

npm install --save gatsby-plugin-sharp

If the error persists, you may need to add windows-build-tools as you can see in the Gatsby on Windows documentation :

npm install --global windows-build-tools --vs2015

The command above, upon installing this package, it downloads and installs Visual C++ Build Tools 2015, provided free of charge by Microsoft. These tools are required to compile popular native modules. It will also install Python 2.7, configuring your machine and npm appropriately.

If your windows-build-tools installation stalls after Visual Studio Build Tools finishes, this remedy might help .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM