简体   繁体   English

无法安装插件NPM

[英]Can't install plugin NPM

I have a cordova ionic application. 我有科尔多瓦离子应用程序。 I'm trying to install a plugin. 我正在尝试安装插件。 I'm not able to. 我不行 The error I have happens on any plugins I try to install really. 我尝试安装的所有插件上都发生了错误。 It happens when I also try to delete a platform for example or run the application on Android. 例如,当我也尝试删除平台或在Android上运行应用程序时,就会发生这种情况。 It just happens all the time. 它一直在发生。 I can't figure out how to fix it. 我不知道如何解决它。 I've tried cleaning the cache, moving the cache location, running everything as administrator, giving full permission to my folder and all its children. 我曾尝试清理缓存,移动缓存位置,以管理员身份运行所有内容,为文件夹及其所有子项授予完全权限。 I'm using Windows 10 as an administrator. 我使用Windows 10作为管理员。

PS C:\Users\mario\Desktop\scmobileapppublic> cordova plugin add cordova-plugin-file-transfer
Error: Failed to fetch plugin cordova-plugin-file-transfer via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: cmd: Command failed with exit code 4294963248 Error output:
npm ERR! path C:\Users\mario\Desktop\scmobileapppublic\node_modules\fsevents\node_modules\aws4\package.json
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall unlink
npm ERR! Error: EPERM: operation not permitted, unlink 'C:\Users\mario\Desktop\scmobileapppublic\node_modules\fsevents\node_modules\aws4\package.json'
npm ERR!     at Error (native)
npm ERR!  { Error: EPERM: operation not permitted, unlink 'C:\Users\mario\Desktop\scmobileapppublic\node_modules\fsevents\node_modules\aws4\package.json'
npm ERR!     at Error (native)
npm ERR!   stack: 'Error: EPERM: operation not permitted, unlink \'C:\\Users\\mario\\Desktop\\scmobileapppublic\\node_modules\\fsevents\\node_modules\\aws4\\package.json\'\n    at Error (native)',
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'unlink',
npm ERR!   path: 'C:\\Users\\mario\\Desktop\\scmobileapppublic\\node_modules\\fsevents\\node_modules\\aws4\\package.json' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\mario\AppData\Roaming\npm-cache\_logs\2017-08-31T21_18_02_104Z-debug.log

Any help would be appreciated! 任何帮助,将不胜感激! Thank you 谢谢

Do not know why, but those steps worked for me : 不知道为什么,但是这些步骤对我有用:

-> remove node_modules folder inside AppData/roaming/npm ->删除AppData /漫游/ npm内的node_modules文件夹

-> open terminal as admin and do following cmd : ->以管理员身份打开终端并执行以下cmd:

npm cache clean --force

Be in mind that will delete all your packages installed globally, Ionic and Cordova in our case. 请注意,在我们的案例中,这将删除全局安装的所有软件包,即Ionic和Cordova。 So you'll need to reinstall them. 因此,您需要重新安装它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM