无法安装“ cordova-plugin-file”-Ionic-cordova

时间:2018-06-26 06:31:04

标签: ionic-framework npm cordova-plugins ionic-native

我正在尝试安装插件

  

ionic cordova插件添加cordova-plugin-文件

我在cmd中遇到错误

  

无法安装“ cordova-plugin-file”:错误:ENOENT:没有此类文件   或导演y,开放   'D:\ product \ project-1 \ frontend \ platforms \ android \ AndroidManifest.xml'       在Object.fs.openSync(fs.js:646:18)       在Object.fs.readFileSync(fs.js:551:33)       在Object.parseElementtreeSync(D:\ product \ project-1 \ frontend \ platforms \ andr   oid \ cordova \ node_modules \ cordova-common \ src \ util \ xml-helpers.js:180:27)       在新的AndroidManifest(D:\ product \ project-1 \ frontend \ platforms \ android \ cord   ova \ lib \ AndroidManifest.js:29:20)       在AndroidProject.getPackageName(D:\ product \ project-1 \ frontend \ platforms \ an   droid \ cordova \ lib \ AndroidProject.js:99:12)       在Api.addPlugin(D:\ product \ project-1 \ frontend \ platforms \ android \ cordova \ Ap   i.js:223:57)       在handleInstall(C:\ Users \ hi \ AppData \ Roaming \ npm \ node_modules \ cordova \ node_   modules \ cordova-lib \ src \ plugman \ install.js:594:10)       在C:\ Users \ hi \ AppData \ Roaming \ npm \ node_modules \ cordova \ node_modules \ cordova   -lib \ src \ plugman \ install.js:357:28       在_fulfilled(C:\ Users \ hi \ AppData \ Roaming \ npm \ node_modules \ cordova \ node_mod   ules \ cordova-lib \ node_modules \ q \ q.js:787:54)       在self.promiseDispatch.done(C:\ Users \ hi \ AppData \ Roaming \ npm \ node_modules \ c   ordova \ node_modules \ cordova-lib \ node_modules \ q \ q.js:816:30)

     

(节点:5240)UnhandledPromiseRejectionWarning:错误:ENOENT:否这样   文件或目录,打开   'D:\ product \ project-1 \ frontend \ platforms \ android \ AndroidManifest.xm l'       在Object.fs.openSync(fs.js:646:18)       在Object.fs.readFileSync(fs.js:551:33)       在Object.parseElementtreeSync(D:\ product \ project-1 \ frontend \ platforms \ andr   oid \ cordova \ node_modules \ cordova-common \ src \ util \ xml-helpers.js:180:27)       在新的AndroidManifest(D:\ product \ project-1 \ frontend \ platforms \ android \ cord   ova \ lib \ AndroidManifest.js:29:20)       在AndroidProject.getPackageName(D:\ product \ project-1 \ frontend \ platforms \ an   droid \ cordova \ lib \ AndroidProject.js:99:12)       在Api.addPlugin(D:\ product \ project-1 \ frontend \ platforms \ android \ cordova \ Ap   i.js:223:57)       在handleInstall(C:\ Users \ hi \ AppData \ Roaming \ npm \ node_modules \ cordova \ node_   modules \ cordova-lib \ src \ plugman \ install.js:594:10)       在C:\ Users \ hi \ AppData \ Roaming \ npm \ node_modules \ cordova \ node_modules \ cordova   -lib \ src \ plugman \ install.js:357:28       在_fulfilled(C:\ Users \ hi \ AppData \ Roaming \ npm \ node_modules \ cordova \ node_mod   ules \ cordova-lib \ node_modules \ q \ q.js:787:54)       在self.promiseDispatch.done(C:\ Users \ hi \ AppData \ Roaming \ npm \ node_modules \ c   ordova \ node_modules \ cordova-lib \ node_modules \ q \ q.js:816:30)   (节点:5240)UnhandledPromiseRejectionWarning:未处理的Promise   拒绝。该错误是由抛出异步内部引起的   没有捕获块或拒绝承诺   未使用.catch()处理。 (拒绝ID:1)(节点:5240)[DEP0018]   DeprecationWarning:已弃用未处理的承诺。在   未来,未处理的承诺拒绝将终止   具有非零退出代码的Node.js进程。

1 个答案:

答案 0 :(得分:0)

ionic cordova rm platform android

然后安装插件。然后重新添加平台。