- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在 React 项目中,我尝试运行“yarn install”,但它抛出了以下错误:
gyp verb
which
failed Error: not found: python2
完整的错误回溯:
yarn install v1.22.4
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@2.1.2: The platform "win32" is incompatible with this module.
info "fsevents@2.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@1.2.12: The platform "win32" is incompatible with this module.
info "fsevents@1.2.12" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > @coreui/coreui@3.0.0" has unmet peer dependency "perfect-scrollbar@^1.5.0".
warning " > @coreui/coreui@3.0.0" has unmet peer dependency "@popperjs/core@^2.0.6".
warning " > @coreui/react@2.5.7" has incorrect peer dependency "@coreui/coreui@^2.1.16".
warning " > @coreui/react@2.5.7" has unmet peer dependency "mutationobserver-shim@^0.3.3".
warning " > @testing-library/user-event@7.2.1" has unmet peer dependency "@testing-library/dom@>=5".
warning " > react-bootstrap-table-next@4.0.1" has unmet peer dependency "classnames@^2.2.5".
warning " > react-bootstrap-table-next@4.0.1" has unmet peer dependency "prop-types@^15.0.0".
warning "react-scripts > @typescript-eslint/eslint-plugin > tsutils@3.17.1" has unmet peer dependency "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".
[4/4] Building fresh packages...
[-/4] ⡀ waiting...
[-/4] ⡀ waiting...
[3/4] ⡀ node-sass
error C:\Users\Rahul\yantra-front\cargo_frontend\cargo-app\node_modules\node-sass: Command failed.
Exit code: 1
Command: node scripts/build.js
Arguments:
Directory: C:\Users\Rahul\yantra-front\cargo_frontend\cargo-app\node_modules\node-sass
Output:
Binary found at C:\Users\Rahul\yantra-front\cargo_frontend\cargo-app\node_modules\node-sass\vendor\win32-x64-72\binding.node
Testing binary
Binary has a problem: Error: Cannot find module './_baseClone'
Require stack:
- C:\Users\Rahul\yantra-front\cargo_frontend\cargo-app\node_modules\lodash\cloneDeep.js
- C:\Users\Rahul\yantra-front\cargo_frontend\cargo-app\node_modules\node-sass\lib\index.js
- C:\Users\Rahul\yantra-front\cargo_frontend\cargo-app\node_modules\node-sass\scripts\build.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:957:15)
at Function.Module._load (internal/modules/cjs/loader.js:840:27)
at Module.require (internal/modules/cjs/loader.js:1019:19)
at require (internal/modules/cjs/helpers.js:77:18)
at Object.<anonymous> (C:\Users\Rahul\yantra-front\cargo_frontend\cargo-app\node_modules\lodash\cloneDeep.js:1:17)
at Module._compile (internal/modules/cjs/loader.js:1133:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
at Module.load (internal/modules/cjs/loader.js:977:32)
at Function.Module._load (internal/modules/cjs/loader.js:877:14)
at Module.require (internal/modules/cjs/loader.js:1019:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Users\\Rahul\\yantra-front\\cargo_frontend\\cargo-app\\node_modules\\lodash\\cloneDeep.js',
'C:\\Users\\Rahul\\yantra-front\\cargo_frontend\\cargo-app\\node_modules\\node-sass\\lib\\index.js',
'C:\\Users\\Rahul\\yantra-front\\cargo_frontend\\cargo-app\\node_modules\\node-sass\\scripts\\build.js'
]
}
Building the binary locally
Building: C:\Program Files\nodejs\node.exe C:\Users\Rahul\yantra-front\cargo_frontend\cargo-app\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libs
ass_library=
gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli 'C:\\Program Files\\nodejs\\node.exe',
gyp verb cli 'C:\\Users\\Rahul\\yantra-front\\cargo_frontend\\cargo-app\\node_modules\\node-gyp\\bin\\node-gyp.js',
gyp verb cli 'rebuild',
gyp verb cli '--verbose',
gyp verb cli '--libsass_ext=',
gyp verb cli '--libsass_cflags=',
gyp verb cli '--libsass_ldflags=',
gyp verb cli '--libsass_library='
gyp verb cli ]
gyp info using node-gyp@3.8.0
gyp info using node@12.16.3 | win32 | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed at getNotFoundError (C:\Users\Rahul\yantra-front\cargo_frontend\cargo-app\node_modules\which\which.js:13:12)
gyp verb `which` failed at F (C:\Users\Rahul\yantra-front\cargo_frontend\cargo-app\node_modules\which\which.js:68:19)
gyp verb `which` failed at E (C:\Users\Rahul\yantra-front\cargo_frontend\cargo-app\node_modules\which\which.js:80:29)
gyp verb `which` failed at C:\Users\Rahul\yantra-front\cargo_frontend\cargo-app\node_modules\which\which.js:89:16
gyp verb `which` failed at C:\Users\Rahul\yantra-front\cargo_frontend\cargo-app\node_modules\isexe\index.js:42:5
gyp verb `which` failed at C:\Users\Rahul\yantra-front\cargo_frontend\cargo-app\node_modules\isexe\windows.js:36:5
gyp verb `which` failed at FSReqCallback.oncomplete (fs.js:167:21)
gyp verb `which` failed python2 Error: not found: python2
gyp verb `which` failed at getNotFoundError (C:\Users\Rahul\yantra-front\cargo_frontend\cargo-app\node_modules\which\which.js:13:12)
gyp verb `which` failed at F (C:\Users\Rahul\yantra-front\cargo_frontend\cargo-app\node_modules\which\which.js:68:19)
gyp verb `which` failed at E (C:\Users\Rahul\yantra-front\cargo_frontend\cargo-app\node_modules\which\which.js:80:29)
gyp verb `which` failed at C:\Users\Rahul\yantra-front\cargo_frontend\cargo-app\node_modules\which\which.js:89:16
gyp verb `which` failed at C:\Users\Rahul\yantra-front\cargo_frontend\cargo-app\node_modules\isexe\index.js:42:5
gyp verb `which` failed at C:\Users\Rahul\yantra-front\cargo_frontend\cargo-app\node_modules\isexe\windows.js:36:5
gyp verb `which` failed at FSReqCallback.oncomplete (fs.js:167:21) {
gyp verb `which` failed code: 'ENOENT'
gyp verb `which` failed }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded python C:\Users\Rahul\AppData\Local\Programs\Python\Python37\python.EXE
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\Users\Rahul\AppData\Local\Programs\Python\Python37\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack File "<string>", line 1
gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack at ChildProcess.exithandler (child_process.js:303:12)
gyp ERR! stack at ChildProcess.emit (events.js:310:20)
gyp ERR! stack at maybeClose (internal/child_process.js:1021:16)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Rahul\\yantra-front\\cargo_frontend\\cargo-app\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cfl
ags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Users\Rahul\yantra-front\cargo_frontend\cargo-app\node_modules\node-sass
gyp ERR! node -v v12.16.3
gyp ERR! node-gyp -v v3.8.0
而我的路径中同时有 python 3 和 2
C:\Python27;C:\Python27\Tools\Scripts
C:\Users\Rahul\.windows-build-tools\python27\
C:\Users\Rahul\AppData\Local\Programs\Python\Python37\
C:\Users\Rahul\AppData\Local\Programs\Python\Python37\Scripts\
C:\Users\Rahul\AppData\Roaming\npm
C:\Users\Rahul\AppData\Local\Yarn\bin
C:\Users\Rahul\AppData\Local\Microsoft\WindowsApps
%USERPROFILE%\AppData\Local\Microsoft\WindowsApps
我无法运行该项目。请帮忙!!
包.json
{
"name": "cargo-app",
"version": "0.1.0",
"private": true,
"dependencies": {
"@coreui/coreui": "^3.0.0",
"@coreui/react": "^2.5.7",
"@fortawesome/fontawesome-svg-core": "^1.2.28",
"@fortawesome/free-solid-svg-icons": "^5.13.0",
"@fortawesome/react-fontawesome": "^0.1.9",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"axios": "^0.19.2",
"history": "^4.10.1",
"node-sass": "^4.14.1",
"react": "^16.13.1",
"react-bootstrap-table-next": "^4.0.1",
"react-dom": "^16.13.1",
"react-redux": "^7.2.0",
"react-router-dom": "^5.1.2",
"react-scripts": "3.4.1",
"react-toastify": "^6.0.0",
"reactjs-localstorage": "^0.0.8",
"reactstrap": "^8.4.1",
"redux": "^4.0.5",
"redux-thunk": "^2.3.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
最佳答案
此 Node 依赖项依赖于 Python 2,而它在您的计算机上找到的 Python 可执行文件是 Python 3。
您可以看到它尝试打印“%s.%s.%s”
——这是 Python 2 语法,在 Python 3 中无效。
您的项目很可能依赖于旧版本的 node-sass,而后者又依赖于过时版本的 node-gyp。尝试在您的依赖项中指定更新版本的 node-sass。
作为替代方案,您也可以尝试使用 this ticket 中概述的解决方法,将以下内容添加到您的 package.json 中:
"resolutions": {
"node-sass/node-gyp": "^6.0.0"
},
但是,最好先看看是否可以切换到更新版本的 node-sass。
关于node.js - yarn 安装抛出错误 : gyp verb `which` failed Error: not found: python2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61744726/
YARN 中的 yarn-site.xml 与 yarn-default.xml 有什么区别?看起来yarn-default.xml 在Hadoop 2.2 中已被弃用? 最佳答案 在所有 Hadoo
我们有一个在 yarn 上运行的流媒体应用程序,我们希望确保它 24/7 全天候运行。 有没有办法告诉 yarn 在失败时自动重启特定的应用程序? 最佳答案 你试过了吗Hadoop Yarn - Re
我在根队列下有 4 个队列,配置如下。 |-------------|-----------------|---------------------|-------------------| | Qu
我正在使用 YARN(和 Dask)版本 Hadoop 2.7.3-amzn-1 在 AWS EMR 上构建应用程序。我正在尝试测试各种故障场景,并且我想模拟容器故障。我似乎找不到一种简单的方法来杀死
我想创建一个 cron 来通过它的应用程序名称杀死一个 yarn 应用程序(Spark)。但我发现 yarn 应用程序 -kill 需要一个应用程序 ID。是否有解决方案可以通过应用程序名称杀死它,或
我正在尝试从此链接运行通用入门套件:https://github.com/ng-seed/universal即使我按照步骤安装了 Yarn,当我运行命令来运行服务器时,它给了我以下错误: 错误:找不到
我正在尝试 YARN 2.2 中的分布式 Shell 示例,希望有人能澄清托管和非托管应用程序管理器之间的区别是什么? 例如以下几行出现在客户端代码中 // unmanaged AM appConte
我有一个像这样的工作区项目: /project - package.json /packages /project-a package.json
这两个到底做什么用,在哪里使用它们? yarn 安装 yarn 构建 最佳答案 简而言之,yarn install 是用于安装项目所有依赖项的命令,通常在 package.json 文件中分配。在大多
所以,到目前为止,似乎没有 yarn audit --fix ,所以我想弄清楚如何修复我的 yarn audit错误。 我试过 yarn upgrade它修复了一些错误(这很好),但仍然存在一些错误。
我正在使用一个使用 yarn 的 dockerized pyspark 集群。为了提高数据处理管道的效率,我想增加分配给 pyspark 执行程序和驱动程序的内存量。 这是通过将以下两个键值对添加到
我尝试重新安装yarn,但重新安装后发现这个问题,我尝试搜索互联网但没有找到解决方案。 fiii@neo:~$ yarn --version node:internal/modules/cjs/loa
我正在试验2号纱和植面。 我创建了一个新文件夹:/projects/yarn2/根据他们的安装指南https://yarnpkg.com/getting-started我跑了 cd /projects
我是hadoop和YARN的新手。启动hdfs之后,我使用软件包中提供的start-yarn.sh启动YARN并出现错误。 我在Ubuntu 18.04上使用hadoop 3.2.0,jdk-11。
Apache Spark最近更新了版本至0.8.1,新增了yarn-client模式。我的问题是,yarn-client 模式的真正含义是什么?在文档中它说: With yarn-client mod
我们有一个在 HDFS 2.7.3 上运行的 Spark 流应用程序,使用 Yarn 作为资源管理器....在运行应用程序时......这两个文件夹 /tmp/hadoop/data/nm-local
我的机器上的 yarn 命令有问题。我的机器上安装了 hadoop 和 yarn 包管理器(Javascript)。当我运行 yarn init 时,它调用 hadoop 的 YARN 并响应: Er
我正在尝试运行此处列出的简单 yarn 应用程序:https://github.com/hortonworks/simple-yarn-app 我是 Java 和 Hadoop 的初学者,当我尝试使用
我正在尝试使用 YARN node labels标记工作节点,但是当我在 YARN(Spark 或简单的 YARN 应用程序)上运行应用程序时,这些应用程序无法启动。 使用 Spark,指定 --co
我一直只使用 npm 而从不显式使用 yarn/webpack。我需要从这个 repo 运行代码: https://github.com/looker-open-source/custom_visua
我是一名优秀的程序员,十分优秀!