由于cors问题,我正在使用Ionic4,并且我想使用本机Ionic HTTP程序包。为此,我必须安装cordova插件:
ionic cordova plugin add cordova-plugin-advanced-http
要求启动和运行Cordova,所以我:
npm install -g cordova
然后我再次尝试安装插件,然后出现下一个错误
由于该服务已被禁用或没有与之关联的启用的设备,因此无法启动该服务。
我也尝试在Windows服务列表中查找该服务,但可以找到它,如何手动启动它?
请注意,我已经尝试过npm uninstall -g cordova
完整错误:
cordova plugin add cordova-plugin-advanced-http --save
\Users\Ezequiel\Desktop\galum\front\testFirebase\node_modules\windows-release\
de_modules\execa\index.js:347
throw err;
^
ror: Command failed: wmic os get Caption
scription = The service cannot be started, either because it is disabled or be
use it has no enabled devices associated with it.
at makeError (c:\Users\Ezequiel\Desktop\galum\front\testFirebase\node_module
windows-release\node_modules\execa\index.js:174:9)
at Function.module.exports.sync (c:\Users\Ezequiel\Desktop\galum\front\testF
ebase\node_modules\windows-release\node_modules\execa\index.js:338:15)
at windowsRelease (c:\Users\Ezequiel\Desktop\galum\front\testFirebase\node_m
ules\windows-release\index.js:34:24)
at osName (c:\Users\Ezequiel\Desktop\galum\front\testFirebase\node_modules\o
name\index.js:39:18)
at new Insight (c:\Users\Ezequiel\Desktop\galum\front\testFirebase\node_modu
s\insight\lib\index.js:37:13)
at Object.<anonymous> (c:\Users\Ezequiel\Desktop\galum\front\testFirebase\no
_modules\cordova\src\telemetry.js:26:15)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
RROR] An error occurred while running subprocess cordova.
cordova plugin add cordova-plugin-advanced-http --save exited with exit
code 1.
Re-running this command with the --verbose flag may provide more
information.
答案 0 :(得分:0)
您应指定要安装的Cordova版本:
npm install -g cordova@8.0.0