当我运行ionic cordova prepare ios / android
时,我遇到了错误和未定义moment
的错误。
从这里开始执行以下步骤
1 .- Remove package-lock.json and yarn.lock
2 .- Install the "moment": "^2.24.0"
3 .- Remove the node_modules folder with `rm -rf node_modules`
4 .- Remove package-lock.json and yarn.lock (again)
5 .- Install node modules with `yarn`
然后我执行ionic cordova prepare ios
并且构建成功,但是当我尝试再次运行该命令时,moment
文件夹中的node_modules
文件夹消失了,有什么方法可以防止这种情况?
我正在使用"@ionic-native/core": "^4.4.0"
,不想升级它。有些软件包与此版本不兼容