我无法在离子5.4.4v中安装Cordova-res软件包,并得到以下错误
**Z:\my program V2\ionicTest\testProj>npm i -g cordova-res**
C:\Users\USER\AppData\Roaming\npm\cordova-res -> C:\Users\USER\AppData\Roaming\npm\node_modules\cordova-res\bin\cordova-res
> sharp@0.22.1 install C:\Users\USER\AppData\Roaming\npm\node_modules\cordova-res\node_modules\sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.7.4/libvips-8.7.4-win32-x64.tar.gz
C:\Users\USER\AppData\Roaming\npm\node_modules\cordova-res\node_modules\sharp\install\libvips.js:83
throw err;
^
##Error: tunneling socket could not be established, cause=connect ECONNREFUSED 127.0.0.1:80##
at ClientRequest.onError (C:\Users\USER\AppData\Roaming\npm\node_modules\cordova-res\node_modules\tunnel-agent\index.js:177:17)
at Object.onceWrapper (events.js:300:26)
at ClientRequest.emit (events.js:210:5)
at Socket.socketErrorListener (_http_client.js:406:9)
at Socket.emit (events.js:210:5)
at emitErrorNT (internal/streams/destroy.js:92:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
{
code: 'ECONNRESET'
}
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\nvm\v12.13.0\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\nvm\v12.13.0\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
* VError.cpp
* VInterpolate.cpp
* VImage.cpp
* win_delay_load_hook.cc
c:\users\user\appdata\roaming\npm\node_modules\cordova-res\node_modules\sharp\src\libvips\cplusplus\verror.cpp(33): fatal error C1083: Cannot open include file: 'vips/intl.h': No such file or directory [C:\Users\USER\AppData\Roam
ing\npm\node_modules\cordova-res\node_modules\sharp\build\libvips-cpp.vcxproj]
c:\users\user\appdata\roaming\npm\node_modules\cordova-res\node_modules\sharp\src\libvips\cplusplus\vimage.cpp(41): fatal error C1083: Cannot open include file: 'vips/intl.h': No such file or directory [C:\Users\USER\AppData\Roam
ing\npm\node_modules\cordova-res\node_modules\sharp\build\libvips-cpp.vcxproj]
c:\users\user\appdata\roaming\npm\node_modules\cordova-res\node_modules\sharp\src\libvips\cplusplus\vinterpolate.cpp(34): fatal error C1083: Cannot open include file: 'vips/intl.h': No such file or directory [C:\Users\USER\AppDat
a\Roaming\npm\node_modules\cordova-res\node_modules\sharp\build\libvips-cpp.vcxproj]不知道错误与什么有关,我认为它不是下载libvip,也不是与sharp有关,那么如何安装sharp是因为当我通过npm安装它时,它也会抛出一个错误。
H 112开始一个新的项目,然后我为Cordova E 113“离子cordova准备”>E 214准备了一个项目,它显示了以下警告H 215F 216
日志:
**[WARN] No platforms added to this project. Cannot prepare native platforms without any installed.**
* Then I added platform via **"ionic cordova platform add android"**, and it showed the following warning:
[WARN] cordova-res was not found on your PATH. Please install it globally:
npm i -g cordova-res
[WARN] Cannot generate resources without cordova-res installed.
Once installed, you can generate resources with the following command:
ionic cordova resources android --force在运行npm i -g cordova-res之后,我得到了更好的结果
发布于 2019-10-31 06:07:27
我成功地安装了它,执行了以下操作:
以root用户身份登录:
su然后安装,但使用--unsafe-perm标志:
npm i -g cordova-res --unsafe-permhttps://stackoverflow.com/questions/58539787
复制相似问题