cordova - 无法安装cordova-res(Windows 10)
问题描述
我想安装cordova-res,但它不会安装。我尝试了很多代码,
npm i -g cordova-res
npm i -g ionic cordova-res
还是行不通。
然后我删除节点模块>>删除android>>做'npm i -g cordova-res',不工作
然后我删除 node-modules >> npm install >> do 'npm i -g cordova-res',不工作
如何安装cordova-res?这是我的离子信息
离子:
Ionic CLI:5.4.16 (C:\Users\user\AppData\Roaming\npm\node_modules\ionic) 离子框架:ionic-angular 3.9.9 @ionic/app-scripts:3.2.4
科尔多瓦:
Cordova CLI:9.0.0 (cordova-lib@9.0.1) Cordova 平台:无 Cordova 插件:cordova-plugin-ionic-keyboard 2.2.0、cordova-plugin-ionic-webview 4.1.3(和其他 6 个插件)
效用:
cordova-res:未安装本机运行:0.3.0
系统:
NodeJS:v8.9.4 (C:\Program Files\nodejs\node.exe) npm:6.12.1 操作系统:Windows 10
这是我得到的错误
C:\Users\user\AppData\Roaming\npm\node_modules\cordova-res\node_modules\sharp>if not defined npm_config_node_gyp
(node "C:\Users\user\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else
(node "C:\Users\user\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp ERR! find Python
gyp ERR! find Python Python is not set from command line or npm configuration
gyp ERR! find Python Python is not set from environment variable PYTHON
gyp ERR! find Python checking if "python" can be used
gyp ERR! find Python - "python" is not in PATH or produced an error
gyp ERR! find Python checking if "python2" can be used
gyp ERR! find Python - "python2" is not in PATH or produced an error
gyp ERR! find Python checking if "python3" can be used
gyp ERR! find Python - "python3" is not in PATH or produced an error
gyp ERR! find Python checking if the py launcher can be used to find Python 2
gyp ERR! find Python - "py.exe" is not in PATH or produced an error
gyp ERR! find Python checking if Python is C:\Python27\python.exe
gyp ERR! find Python - "C:\Python27\python.exe" could not be run
gyp ERR! find Python checking if Python is C:\Python37\python.exe
gyp ERR! find Python - "C:\Python37\python.exe" could not be run
gyp ERR! find Python
gyp ERR! find Python **********************************************************
gyp ERR! find Python You need to install the latest version of Python.
gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
gyp ERR! find Python you can try one of the following options:
gyp ERR! find Python - Use the switch --python="C:\Path\To\python.exe"
gyp ERR! find Python (accepted by both node-gyp and npm)
gyp ERR! find Python - Set the environment variable PYTHON
gyp ERR! find Python - Set the npm configuration variable python:
gyp ERR! find Python npm config set python "C:\Path\To\python.exe"
gyp ERR! find Python For more information consult the documentation at:
gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
gyp ERR! find Python **********************************************************
gyp ERR! find Python
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Python installation to use
gyp ERR! stack at PythonFinder.fail (C:\Users\user\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-python.js:307:47)
gyp ERR! stack at PythonFinder.runChecks (C:\Users\user\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-python.js:136:21)
gyp ERR! stack at PythonFinder.<anonymous> (C:\Users\user\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-python.js:225:16)
gyp ERR! stack at PythonFinder.execFileCallback (C:\Users\user\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-python.js:271:16)
gyp ERR! stack at exithandler (child_process.js:282:5)
gyp ERR! stack at ChildProcess.errorhandler (child_process.js:294:5)
gyp ERR! stack at emitOne (events.js:116:13)
gyp ERR! stack at ChildProcess.emit (events.js:211:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:196:12)
gyp ERR! stack at onErrorNT (internal/child_process.js:372:16)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\user\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\40450\AppData\Roaming\npm\node_modules\cordova-res\node_modules\sharp
gyp ERR! node -v v8.9.4
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
npm WARN notsup Unsupported engine for cordova-res@0.9.0: wanted: {"node":">=10.3.0"} (current: {"node":"8.9.4","npm":"6.12.1"})
npm WARN notsup Not compatible with your version of node/npm: cordova-res@0.9.0
npm WARN notsup Unsupported engine for sharp@0.24.0: wanted: {"node":">=10.13.0"} (current: {"node":"8.9.4","npm":"6.12.1"})
npm WARN notsup Not compatible with your version of node/npm: sharp@0.24.0
npm WARN notsup Unsupported engine for semver@7.1.2: wanted: {"node":">=10"} (current: {"node":"8.9.4","npm":"6.12.1"})
npm WARN notsup Not compatible with your version of node/npm: semver@7.1.2
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp@0.24.0 install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sharp@0.24.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\40450\AppData\Roaming\npm-cache\_logs\2020-02-07T00_57_49_685Z-debug.log
解决方案
推荐阅读
- csv - 如果从 UTF-16 LE(使用 -u)转换为 UTF-8,使用 unicode 导出的 csvde 文件是否会丢失字符?
- amazon-web-services - 保存数据的最佳方法 Lambda 函数
- android - 如何修复 ActivityThread 致命异常:java.lang.RuntimeException?
- python - 未定义的变量,在 if 之后
- java - 如何将 Android 软键盘移动到屏幕顶部?
- pyspark - 在 pyspark 中使用窗口函数时,结果 parquet 文件大小变大
- php - 如何将 XML 文件中的值添加到 php 中的 csv 文件?
- java - 肥皂请求 XML。来自 WSDL
- graphql - Hasura 选择子项包含当前用户的项目
- javascript - 如何在 typescript 中使用 Cypress 监视导入的函数