所以我开始了一个新的Cordova项目。
cordova create myprojectname com.myproject MyProject
然后添加Android平台。
cordova platform add android
然后我添加iOS平台
cordova platform add ios
然后我尝试添加插件。
cordova plugin add cordova-plugin-wkwebview-engine
我收到此错误:
Failed to fetch plugin cordova-plugin-wkwebview-engine via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: npm: Command failed with exit code 4294963238 Error output:
npm WARN [email protected] No repository field.
npm ERR! code ENOENT
npm ERR! syscall rename
npm ERR! path C:\PATH-TO-MY-PROJECT\myprojectname\node_modules\cordova-plugin-wkwebview-engine
npm ERR! dest C:\PATH-TO-MY-PROJECT\myprojectname\node_modules\.cordova-plugin-wkwebview-engine.DELETE
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\PATH-TO-MY-PROJECT\myprojectname\node_modules\cordova-plugin-wkwebview-engine' -> 'C:\PATH-TO-MY-PROJECT\myprojectname\node_modules\.cordova-plugin-wkwebview-engine.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\PATH-TO-MY-APP-DATA\AppData\Roaming\npm-cache\_logs\2020-06-09T01_12_38_805Z-debug.log
事实上,对于我尝试安装的所有插件,我都会收到此错误。
我在这些版本中使用Node.js命令提示符:
npm: '6.14.5'
node: '12.13.1 (x64)'
cordova: '9.0.0 ([email protected])'
cordova-android: '^8.1.0'
cordova-ios: '^5.1.1'
我如何开始安装插件?
更新1我应该声明,如果我将cordova还原到7.0.0或更低版本,则可以安装插件。但是,我确实需要保持最新状态才能定位到新的iOS 5+平台。
好,这是各种各样的答案。
当我在Dropbox目录的outside中的项目中工作时,一切正常。
有趣的是-多年来,我一直在Dropbox目录中创建/构建cordova应用程序,而且没有任何问题,因为我敢肯定很多人都会这样做。所以这对我来说有点不容易。
我不知道为什么,但是在这种情况下,答案是bizarely:在Dropbox之外工作。