打包版本:
我是NPM的新手,一直在努力创造一个离子2应用程序。我无法弄清楚如何解决所有这些包版本的冲突。在我执行的图片中显示的命令之前:清除node_modules,npm cache clean,npm unpdate -g npm和npm install。
这是我的package.json:
{
"name": "io.cordova.myappb7116d",
"author": "",
"homepage": "",
"private": true,
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve"
},
"dependencies": {
"@angular/common": "2.2.1",
"@angular/compiler": "2.2.1",
"@angular/compiler-cli": "2.2.1",
"@angular/core": "2.2.1",
"@angular/forms": "2.2.1",
"@angular/http": "2.2.1",
"@angular/platform-browser": "2.2.1",
"@angular/platform-browser-dynamic": "2.2.1",
"@angular/platform-server": "2.2.1",
"@ionic-native/core": "^3.1.0",
"@ionic-native/http": "^3.4.4",
"@ionic-native/native-storage": "^3.4.4",
"ionic-angular": "2.0.0-rc.4",
"ionic-native": "2.2.11",
"ionicons": "3.0.0",
"localforage-cordovasqlitedriver": "^1.6.0",
"npm-install-version": "^6.0.1",
"rxjs": "^5.0.1",
"sw-toolbox": "^3.6.0",
"uuid": "^3.0.1",
"zone.js": "0.6.26"
},
"devDependencies": {
"@ionic/app-scripts": "^1.1.4",
"typescript": "2.0.9"
},
"cordovaPlugins": [
"cordova-plugin-whitelist",
"cordova-plugin-console",
"cordova-plugin-statusbar",
"cordova-plugin-device",
"cordova-plugin-splashscreen",
"ionic-plugin-keyboard"
],
"cordovaPlatforms": [],
"-vs-binding": {
"BeforeBuild": [
"ionic:build"
]
}
}
答案 0 :(得分:0)
感谢Fernando的建议,实际上我还没有手动编辑package.json到目前为止,我认为npm会管理安装最新软件包版本的版本冲突。
最后我编辑了packages.json,以便切换到最新的离子版https://github.com/driftyco/ionic/blob/master/CHANGELOG.md#steps-to-upgrade
之后我执行了NPM INSTALL,错误消失了。