- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
问题
我正在尝试在 Windows 上设置 Gatsby 入门项目。具体来说,这个启动项目:https://www.gatsbyjs.com/starters/hasura/gatsby-gitbook-starter/
版本:
节点:v14.10.1
npm:6.14.8
Gatsby CLI 版本:2.12.99
Gatsby 版本:2.18.10
创建错误的初始步骤:
我打开一个新终端并根据文档运行 Gatsby Starter 脚本:
"gatsby new gatsby-gitbook-starter https://github.com/hasura/gatsby-gitbook-starter"
在初始启动器成功克隆后,我被指示 cd 进入目录并运行“gatsby-develop”。
success open and validate gatsby-configs - 0.081s
ERROR
Something went wrong installing the "sharp" module
Cannot find module '../build/Release/sharp.node'
Require stack:
- C:\code\Sutro\gatsby-gitbook-starter2\node_modules\sharp\lib\constructor.js
- C:\code\Sutro\gatsby-gitbook-starter2\node_modules\sharp\lib\index.js
- C:\code\Sutro\gatsby-gitbook-starter2\node_modules\gatsby-plugin-sharp\safe-sharp.js
- C:\code\Sutro\gatsby-gitbook-starter2\node_modules\gatsby-plugin-sharp\index.js
- C:\code\Sutro\gatsby-gitbook-starter2\node_modules\gatsby-plugin-sharp\gatsby-node.js
- C:\code\Sutro\gatsby-gitbook-starter2\node_modules\gatsby\dist\bootstrap\resolve-module-exports.js
- C:\code\Sutro\gatsby-gitbook-starter2\node_modules\gatsby\dist\bootstrap\load-plugins\validate.js
- C:\code\Sutro\gatsby-gitbook-starter2\node_modules\gatsby\dist\bootstrap\load-plugins\load.js
- C:\code\Sutro\gatsby-gitbook-starter2\node_modules\gatsby\dist\bootstrap\load-plugins\index.js
- C:\code\Sutro\gatsby-gitbook-starter2\node_modules\gatsby\dist\bootstrap\index.js
- C:\code\Sutro\gatsby-gitbook-starter2\node_modules\gatsby\dist\commands\develop.js
- C:\Users\mxgel\AppData\Roaming\npm\node_modules\gatsby-cli\lib\create-cli.js
- C:\Users\mxgel\AppData\Roaming\npm\node_modules\gatsby-cli\lib\index.js
- C:\Users\mxgel\AppData\Roaming\npm\node_modules\gatsby-cli\cli.js
- Remove the "node_modules/sharp" directory, run "npm install" and look for errors
- Consult the installation documentation at https://sharp.pixelplumbing.com/en/stable/install/
- Search for this error at https://github.com/lovell/sharp/issues
⠋ load plugins
我的预感是,这个错误是由于一些我无法弄清楚的全局包管理器配置而引发的,而不是 Sharp 依赖项本身。我的目标是使用这个 Gatsby starter 来简化项目文档的过程。
added 2 packages from 60 contributors and audited 2713 packages in 12.906s
54 packages are looking for funding
run `npm fund` for details
found 1219 vulnerabilities (1168 low, 2 moderate, 49 high)
run `npm audit fix` to fix them, or `npm audit` for details
删除了 Sharp 模块,重新安装了 Verbose 标志
npm info it worked if it ends with ok
npm verb cli [
npm verb cli 'C:\\nodejs\\node.exe',
npm verb cli 'C:\\Users\\mxgel\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
npm verb cli 'install',
npm verb cli 'sharp',
npm verb cli '--verbose'
npm verb cli ]
npm info using npm@6.14.8
npm info using node@v14.10.1
npm verb npm-session 166ad6819380c39e
npm http fetch GET 304 https://registry.npmjs.org/sharp 240ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/sharp/-/sharp-0.26.1.tgz 103ms (from cache)
npm timing stage:loadCurrentTree Completed in 3562ms
npm timing stage:loadIdealTree:cloneCurrentTree Completed in 44ms
npm timing stage:loadIdealTree:loadShrinkwrap Completed in 938ms
npm http fetch GET 304 https://registry.npmjs.org/semver 85ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/fsevents 114ms (from cache)
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm http fetch GET 304 https://registry.npmjs.org/bindings 145ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/file-uri-to-path 101ms (from cache)
npm timing stage:loadIdealTree:loadAllDepsIntoIdealTree Completed in 8627ms
npm timing stage:loadIdealTree Completed in 10371ms
npm timing stage:generateActionsToTake Completed in 190ms
npm verb correctMkdir C:\Users\mxgel\AppData\Roaming\npm-cache\_locks correctMkdir not in flight; initializing
npm verb makeCacheDir UID & GID are irrelevant on win32
npm verb lock using C:\Users\mxgel\AppData\Roaming\npm-cache\_locks\staging-cfcdc7ee6147183b.lock for C:\code\Sutro\gatsby-gitbook-starter2\node_modules\.staging
npm timing action:extract Completed in 291ms
npm timing audit submit Completed in 321ms
npm http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/audits/quick 324ms
npm timing audit body Completed in 4ms
npm timing action:finalize Completed in 19ms
npm timing action:refresh-package-json Completed in 93ms
npm info lifecycle file-uri-to-path@1.0.0~preinstall: file-uri-to-path@1.0.0
npm info lifecycle bindings@1.5.0~preinstall: bindings@1.5.0
npm info lifecycle semver@7.3.2~preinstall: semver@7.3.2
npm info lifecycle sharp@0.26.1~preinstall: sharp@0.26.1
npm timing action:preinstall Completed in 7ms
npm info linkStuff file-uri-to-path@1.0.0
npm info linkStuff bindings@1.5.0
npm info linkStuff semver@7.3.2
npm verb linkBins [
npm verb linkBins { semver: 'bin/semver.js' },
npm verb linkBins 'C:\\code\\Sutro\\gatsby-gitbook-starter2\\node_modules\\sharp\\node_modules\\.bin',
npm verb linkBins false
npm verb linkBins ]
npm info linkStuff sharp@0.26.1
npm timing action:build Completed in 68ms
npm info lifecycle file-uri-to-path@1.0.0~install: file-uri-to-path@1.0.0
npm info lifecycle bindings@1.5.0~install: bindings@1.5.0
npm info lifecycle semver@7.3.2~install: semver@7.3.2
npm info lifecycle sharp@0.26.1~install: sharp@0.26.1
npm info lifecycle sharp@0.26.1~install: ignored because ignore-scripts is set to true sharp@0.26.1
npm timing action:install Completed in 32ms
npm info lifecycle file-uri-to-path@1.0.0~postinstall: file-uri-to-path@1.0.0
npm info lifecycle bindings@1.5.0~postinstall: bindings@1.5.0
npm info lifecycle semver@7.3.2~postinstall: semver@7.3.2
npm info lifecycle sharp@0.26.1~postinstall: sharp@0.26.1
npm timing action:postinstall Completed in 46ms
npm verb unlock done using C:\Users\mxgel\AppData\Roaming\npm-cache\_locks\staging-cfcdc7ee6147183b.lock for C:\code\Sutro\gatsby-gitbook-starter2\node_modules\.staging
npm timing stage:executeActions Completed in 648ms
npm timing stage:rollbackFailedOptional Completed in 1ms
npm timing stage:runTopLevelLifecycles Completed in 15394ms
npm verb saving [ { name: 'sharp', spec: '^0.26.1', save: 'dependencies' } ]
npm verb shrinkwrap skipping write for package.json because there were no changes.
npm info lifecycle undefined~preshrinkwrap: undefined
npm info lifecycle gatsby-gitbook-boilerplate@0.0.1~shrinkwrap: gatsby-gitbook-boilerplate@0.0.1
npm notice created a lockfile as package-lock.json. You should commit this file.
npm info lifecycle gatsby-gitbook-boilerplate@0.0.1~postshrinkwrap: gatsby-gitbook-boilerplate@0.0.1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules\babel-plugin-add-module-exports\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS: darwin
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch: any
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS: win32
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.1 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS: darwin
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch: any
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS: win32
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
npm WARN acorn-class-fields@0.2.1 requires a peer of acorn@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN acorn-dynamic-import@4.0.0 requires a peer of acorn@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN tsutils@3.17.1 requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must
install peer dependencies yourself.
+ sharp@0.26.1
added 4 packages from 66 contributors and audited 2666 packages in 16.799s
60 packages are looking for funding
run `npm fund` for details
found 1206 vulnerabilities (1157 low, 2 moderate, 47 high)
run `npm audit fix` to fix them, or `npm audit` for details
npm verb exit [ 0, true ]
npm timing npm Completed in 18411ms
npm info ok
现有的堆栈溢出解决方案
npm install sharp --ignore-scripts
这仍然没有解决问题,并抛出了同样的错误。
npm install --unsafe-perm
使用 'gatsby develop' 后仍然抛出 Sharp Error
npm rebuild
我什至尝试过 yarn
最佳答案
@Ferran 为我指出了最好的方向:Gatsby 文档。
不确定是什么导致了这个错误,但我完全重置了我的 Windows 10,然后从头开始重新安装了 Node、NPM、Gatsby。
现在所有命令都可以正常工作,没有明显的模块错误!我的驱动器上一定有一些环境冲突。
关于npm - 安装 Gatsby Starter 'Something went wrong installing the "尖锐“模块时出错”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63997253/
有什么区别: spring-boot-starter-web spring-boot-starter-web-services spring-boot-starter-jersey? 文档说 Star
我注意到 Spring Boot Sample Data Redis 声明了以下依赖项: org.springframework.boot spring-boot-starter
我正在观看有关 Spring Boot 的视频教程(来自 javabrains.io)。示例项目的 pom 文件包含一个父 block ,其 groupId 为 org.springframework
我正在努力尝试使用 spring boot (1.1.6.RELEASE)、gradle (2.1) 和 Java 1.8 来练习一些技术。所以我们正在考虑支持一些旧式 SOAP Web 服务调用以及
我正在尝试学习 Spring Boot,但我注意到有两种选择。 spring-boot-starter-web - 根据文档,它支持全栈 Web 开发,包括 Tomcat 和 web-mvc spri
我正在尝试在 IntellIJ 中开发一个基于 Spring Boot 的示例应用程序。所以我使用了 spring Initialzr 方法,并在设置过程中进行了默认选择。我最终得到的 pom.xml
是否可以在一个应用程序中同时使用这两个启动器? 我想将 CSV 文件中的记录加载到数据库表中。 Spring Batch 表存储在不同的数据库中,因此我假设我需要使用 JTA 来处理事务。 每当我将
我有一个微服务应用程序,在我包含的 JAR 依赖项之一中 org.springframework.boot spring-boot-starter-webflux 所以我可以使用响
当我开始学习spring-webflux时,我对这个组件有疑问。 我构建了一个简单的项目,使用maven来管理它。我添加了与 spring-boot-starter-web 和 spring-boot
我已经使用 optaplanner-spring-boot-starter 作为依赖项开发了一个完整的工作 spring boot 项目,用于任务分配,但要求是使用 kie-server-spring
当我开始学习spring-webflux时,我对这个组件有疑问。 我构建了一个简单的项目,使用 maven 来管理它。我添加了与 spring-boot-starter-web 和 spring-bo
我尝试了 spring-boot-starter-actuator,默认指令,在 pom 中添加到 spring boot 项目,它运行没有任何问题。 一旦我添加 spring-boot-starte
我当时尝试包含上述依赖项之一,但找不到任何区别: spring boot starter web:我可以看到 Flux 和 Mono 类并制作一个响应式(Reactive)休息 Controller
我们将 spring-cloud-starter-hystrix 与 spring-cloud-starter-archaius 一起使用,一旦 war 取消部署,我们将无法停止 archaius 的
我刚刚开始使用 OAuth2 学习 Spring Security,我想为我的微服务 Restful Api 创建授权服务器和资源服务器。但是我不知道从哪个依赖项开始,因为我找到了其中的一些。我使用
我正在使用 spring-boot-starter-jersey 和 spring-boot-starter-tomcat (v. 1.5.2) 和作为因此,我宁愿不添加 spring-boot-st
我正在尝试对微服务的端点实现基本身份验证。所以我使用了 spring-boot-starter-security。但我注意到 spring-boot-starter-security 不适用于 spr
我想使用 spring-boot-starter,但这意味着我必须使用“spring-boot-starter-parent”pom 而不能使用公司广泛使用的根 pom。 Spring-boot-st
目前我们正在使用 com.graphql-java-kickstart graphql-spring-boot-starter ${graph
我是 Spring Cloud 的新手,两者之间的确切区别是什么spring-cloud-starter-eureka-server和 spring-cloud-starter-netflix-eur
我是一名优秀的程序员,十分优秀!