科尔多瓦找不到模块 [英] Cordova cannot find module

查看:88
本文介绍了科尔多瓦找不到模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在寻找解决方案,但找不到任何可行的方法.

I allready searched for solutions but couldn't find anything that works.

我正在尝试使用cordova构建/运行apk,但是仿真器(以及我的手机)无法启动该应用程序,并且安装失败. 我试图重新创建projet并重新安装cordova,但是遇到了这个问题:

I'm trying to build / run apk with cordova but the emulator (and also my phone) won't start the app and fail on installation. I tried to re-create the projet and re-install cordova but have this issue :

错误:找不到模块 'C:\ Users \ ... \ AppData \ Roaming \ npm \ node_modules \ cordova \ bin \ cordova'

Error: Cannot find module 'C:\Users\...\AppData\Roaming\npm\node_modules\cordova\bin\cordova'

我也想做:

npm缓存清理

npm cache clean

什么都没用,有人可以帮我吗? 谢谢!

Nothing is working, can someone help me please ? Thank you !

推荐答案

我知道,这个问题有点老了,但是我遇到了同样的问题,因此我用这种方法绕过"了它.

I know, this question is kinda old but I got the same problem and I "by-pass" it with this method.

(已解决)错误:找不到模块'C:... \ node_modules \ cordova \ bin \ cordova'#3301

实际上,使用离子(Ionic CLI):3.20.0

Actually, using ionic (Ionic CLI) : 3.20.0

首先,检查计算机上的JRE安装,如果可以,请按照以下步骤操作

first of all, check the JRE installation on your computer, if is ok, follow this steps

  1. ionic serve
  2. cordova clean android(或IOS)
  3. rm -rf node_modules(只需删除node_modules文件夹)
  4. npm install
  5. cordova build android(不含离子)
  1. ionic serve
  2. cordova clean android (or IOS)
  3. rm -rf node_modules (just delete node_modules folder)
  4. npm install
  5. cordova build android (without ionic)

它将为您的项目添加插件,并将其编译为APK.

It will add plugins to your project and also will compile it to an APK.

只需创建另一个项目,将"src"文件夹复制到新的项目即可开始使用!

Just create another project, copy the "src" folder to the new one and ready to go!

这篇关于科尔多瓦找不到模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆