When a try to run
当试着跑
ionic run android --device
I'm getting an error of module:
我收到模块错误:
Error: Cannot find module 'android-versions'
Versions:
版本:
java -version
java version "1.8.0_144"
Android studio Version 2.3.3
ionic -v
2.2.1
cordova -v
6.5.0
3 个解决方案
#1
81
I found the problem and expect help somebody. I just run
我发现了这个问题并期待帮助某人。我跑了
npm install android-versions --save
in the project folder and worked.
在项目文件夹中工作。
#2
15
Not sure if this will help some other Ionic developers, but I was getting the same Error: Cannot find module 'android-versions'
and I fixed it by removing and adding the Android platform again:
不确定这是否会帮助其他一些Ionic开发人员,但我得到了相同的错误:找不到模块'android-versions',我通过删除并再次添加Android平台来修复它:
ionic cordova platform remove android --save
And then
接着
ionic cordova platform add android --save
#3
4
If anyone is having this issue while using yarn
and even after adding android-versions
... it seems that there are differences in yarn
/npm
files which break...
如果有人在使用纱线时遇到这个问题,甚至在添加了android-versions之后...似乎在纱线/ npm文件中存在差异而导致...
I ended up removing my node_modules
folder, then installing it with npm
instead of yarn
. It worked!
我最终删除了我的node_modules文件夹,然后用npm而不是yarn安装它。有效!
#1
81
I found the problem and expect help somebody. I just run
我发现了这个问题并期待帮助某人。我跑了
npm install android-versions --save
in the project folder and worked.
在项目文件夹中工作。
#2
15
Not sure if this will help some other Ionic developers, but I was getting the same Error: Cannot find module 'android-versions'
and I fixed it by removing and adding the Android platform again:
不确定这是否会帮助其他一些Ionic开发人员,但我得到了相同的错误:找不到模块'android-versions',我通过删除并再次添加Android平台来修复它:
ionic cordova platform remove android --save
And then
接着
ionic cordova platform add android --save
#3
4
If anyone is having this issue while using yarn
and even after adding android-versions
... it seems that there are differences in yarn
/npm
files which break...
如果有人在使用纱线时遇到这个问题,甚至在添加了android-versions之后...似乎在纱线/ npm文件中存在差异而导致...
I ended up removing my node_modules
folder, then installing it with npm
instead of yarn
. It worked!
我最终删除了我的node_modules文件夹,然后用npm而不是yarn安装它。有效!