无法添加 cordova 插件
Not able to add cordova plugins
我正在尝试将 cordova 插件添加到我的项目中。直到昨天我都成功地做到了。但是突然间我无法从我的本地系统添加插件。它给了我以下错误。
$ cordova plugin add C:\Users\ankur\CoolPlugin
Fetching plugin "C:UsersankurCoolPlugin" via npm
npm http GET https://registry.npmjs.org/C%3AUsersankurCoolPlugin
npm http 404 https://registry.npmjs.org/C%3AUsersankurCoolPlugin
Fetching from npm failed: 404 Not Found: C%3AUsersankurCoolPlugin
Error: 404 Not Found: C%3AUsersankurCoolPlugin
at RegClient. (c:\Users\ankur\AppData\Roaming\npm\node_modules\co
rdova\node_modules\cordova-lib\node_modules\npm\node_modules\npm-registry-client
\lib\request.js:268:14)
at Request.self.callback (c:\Users\ankur\AppData\Roaming\npm\node_modules\co
rdova\node_modules\cordova-lib\node_modules\npm\node_modules\request\index.js:140
8:22)
at Request.emit (events.js:110:17)
at Request. (c:\Users\ankur\AppData\Roaming\npm\node_modules\cord
ova\node_modules\cordova-lib\node_modules\npm\node_modules\request\index.js:876:
14)
at Request.emit (events.js:129:20)
at IncomingMessage. (c:\Users\ankur\AppData\Roaming\npm\node_modu
les\cordova\node_modules\cordova-lib\node_modules\npm\node_modules\request\index
.js:827:12)
at IncomingMessage.emit (events.js:129:20)
at _stream_readable.js:908:16
at process._tickCallback (node.js:355:11)
我无法弄清楚为什么当我是 运行 cordova 插件时抛出错误“错误:404 未找到:C%3AUsersankurCoolPlugin”添加 C:\Users\ankur\CoolPlugin 。令人惊讶的是,我能够从 github 成功添加一个插件。
非常感谢。
您必须指定包含您的 plugin.xml 文件的文件夹的本地路径。
如果仍然失败,您可以尝试将您的插件上传到 git 并从那里拉取它。
我正在尝试将 cordova 插件添加到我的项目中。直到昨天我都成功地做到了。但是突然间我无法从我的本地系统添加插件。它给了我以下错误。
$ cordova plugin add C:\Users\ankur\CoolPlugin Fetching plugin "C:UsersankurCoolPlugin" via npm npm http GET https://registry.npmjs.org/C%3AUsersankurCoolPlugin npm http 404 https://registry.npmjs.org/C%3AUsersankurCoolPlugin Fetching from npm failed: 404 Not Found: C%3AUsersankurCoolPlugin Error: 404 Not Found: C%3AUsersankurCoolPlugin at RegClient. (c:\Users\ankur\AppData\Roaming\npm\node_modules\co rdova\node_modules\cordova-lib\node_modules\npm\node_modules\npm-registry-client \lib\request.js:268:14) at Request.self.callback (c:\Users\ankur\AppData\Roaming\npm\node_modules\co rdova\node_modules\cordova-lib\node_modules\npm\node_modules\request\index.js:140 8:22) at Request.emit (events.js:110:17) at Request. (c:\Users\ankur\AppData\Roaming\npm\node_modules\cord ova\node_modules\cordova-lib\node_modules\npm\node_modules\request\index.js:876: 14) at Request.emit (events.js:129:20) at IncomingMessage. (c:\Users\ankur\AppData\Roaming\npm\node_modu les\cordova\node_modules\cordova-lib\node_modules\npm\node_modules\request\index .js:827:12) at IncomingMessage.emit (events.js:129:20) at _stream_readable.js:908:16 at process._tickCallback (node.js:355:11)
我无法弄清楚为什么当我是 运行 cordova 插件时抛出错误“错误:404 未找到:C%3AUsersankurCoolPlugin”添加 C:\Users\ankur\CoolPlugin 。令人惊讶的是,我能够从 github 成功添加一个插件。
非常感谢。
您必须指定包含您的 plugin.xml 文件的文件夹的本地路径。
如果仍然失败,您可以尝试将您的插件上传到 git 并从那里拉取它。