买了一台新电脑,从GitHub克隆了我的项目,然后运行npm install
,但后来它安装时出现了很多错误,所以现在我运行gatsby develop
,得到了下面的错误消息。请帮我
错误#10226配置
找不到";gatsby-plugin-sharp";插件在";C: \Users\Administrator\Desktop\Projects\IamJude\gatsby-config.js"。
尝试在C:\Users\Administrator\Desktop\Projects\IamJude\plugins\gatsby-plugin-sharp中查找本地插件。
尝试在以下路径中查找已安装的程序包:
- 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
未完成打开和验证盖茨比配置-1.329s
错误
组件中出现上述错误:在CLI中(由ConnectedCLI创建(在ConnectedCLI中在StoreStateProvider中应用程序内
React将尝试使用您提供的错误边界App从头开始重新创建此组件树。
错误
警告:应用程序:错误边界应实现getDerivedStateFromError((。在该方法中,返回状态更新以显示错误消息或回退UI。
C: \Users\Administrator\AppData\Roaming\npm\node_modules\gatsby-cli\node_modeles\yoga layout prebuilded\yoga layout\build\Release \nbind.js:53
throw-ex;^
TypeError:无法读取未定义的属性"activities"在getGlobalStatus(C:\Users\Administrator\AppData\Roaming\npm\node_modules\gatsby-cli\lib\reporter\redux\utils.js:25:54(在createPendingActivity(C:\Users\Administrator\AppData\Roaming\npm\node_modules\gatsby-cli\lib\reporter\redux\internal actions.js:111:51(
在C:\Users\Administrator\AppData \Roaming\npm\node_modeles\gatsby-cli\node_modules\eredux\lib\redux.js:483:35在premateEnd(C:\Users\Administrator\AppData\Roaming\npm\node_modules\gatsby-cli\lib\reporter\catch-exit-signals.js:39:38(位于Reporter.panic(C:\Users\Administrator\AppData\Roaming\npm\node_modules\gatsby-cli\lib\Reporter\Reporter.js:72:42(正在处理中。(C:\Users\Administrator\AppData\Roaming\npm\node_modules\gatsby-cli\lib\index.js:79:21(在process.emit(events.js:327:22(在processEmit(C:\Users\Administrator\AppData\Roaming\npm\node_modules\gatsby-cli\node_modules\signal exit\index.js:161:32(在process.emit(C:\Users\Administrator\AppData\Roaming\npm\node_modules\gatsby-cli\node_modules@turist\fetch\dist\sourcemap register.js:926:21(在processEmit[as-emit](C:\Users\Administrator\Desktop\Projects\IamJude\node_modules\gatsby\node_modules \gatsby-cli\node_modeles\signal exit\index.js:161:32(在processPromiseRejections(internal/process/promise.js:209:33(在processTicksAndRejections(internal/process/task_queues.js:98:32(
package.json的内容是什么?
您安装了gatsby-plugin-sharp
吗?
也许试试npm install --save gatsby-plugin-sharp
在Windows中,您可能需要添加一些额外的包来运行项目。首先,我将尝试手动添加gatsby-plugin-sharp
通过:
npm install --save gatsby-plugin-sharp
如果错误仍然存在,您可能需要添加windows-build-tools
,如您在Gatsby on Windows文档中所见:
npm install --global windows-build-tools --vs2015
上面的命令在安装此软件包后,将下载并安装Microsoft免费提供的Visual C++Build Tools 2015。编译流行的本机模块需要这些工具。它还将安装Python2.7,适当地配置您的机器和npm。
如果您的windows-build-tools
安装在Visual Studio生成工具完成后暂停,此补救措施可能会有所帮助。