我正在尝试构建一个离子项目,当我尝试使用命令时ionic capacitor run android
我收到一条错误消息:[error] Unable to find node_modules/cordova-plugin-whitelist. Are you sure cordova-plugin-whitelist is installed?
[ERROR] An error occurred while running subprocess capacitor.
并且我检查了是否安装了cordova-plugin-whitelist,它是Plugin "cordova-plugin-whitelist" already installed on android.
Adding cordova-plugin-whitelist to package.json
如何解决此问题?
在为cordova插件安装npm软件包后,在运行npx cap sync
时出现了“无法找到node_modules / X”的问题。 (上下文:尝试在我的Capacitor项目中使用Cordova插件)
我通过以下方式解决了它:
npm install
。npx cap sync
。npx cap sync
命令然后成功完成。