错误无法找到node_modules / cordova-plugin-whitelist

问题描述 投票:0回答:1

我正在尝试构建一个离子项目,当我尝试使用命令时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如何解决此问题?

angularjs ionic-framework ionic2 ionic3 ionic4
1个回答
0
投票

在为cordova插件安装npm软件包后,在运行npx cap sync时出现了“无法找到node_modules / X”的问题。 (上下文:尝试在我的Capacitor项目中使用Cordova插件)

我通过以下方式解决了它:

  1. 关闭我的代码编辑器(导致步骤2出现问题。
  2. 正在运行npm install
  3. 再次运行npx cap sync

npx cap sync命令然后成功完成。

© www.soinside.com 2019 - 2024. All rights reserved.