So after following the first two steps in the guide here (node and npm version match minimum reqs)
http://blog.ionic.io/announcing-ionic-cli-v3/
So just running npm uninstall -g ionic
followed by npm install -g ionic@latest
when I run ionic info
or any ionic command, I get the error:
{ Error: Cannot find module '/home/path/node_modules/ionic' at Function.Module._resolveFilename (module.js:469:15) at Function.Module._load (module.js:417:25) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at /home/oem/.nvm/versions/node/v6.9.5/lib/node_modules/ionic/bin/ionic:18:13 code: 'MODULE_NOT_FOUND' }
I tried several things, removed the node_modules folder and ran npm install
, I even kept the ionic@2.2.1 installed and installed the latest version, also still got the same error. If I get out of the project folder and run ionic info
it works, so I suspect it’s something wrong with my project? Below is my project package.json
{
"name": "myapp",
"author": "myauthor",
"homepage": "https://website.com",
"private": true,
"scripts": {
"ionic-serve": "ionic serve",
"build-dev": "ionic-app-scripts build --dev",
"build": "ionic-app-scripts build",
"watch": "ionic-app-scripts watch",
"serve:before": "watch",
"emulate:before": "build",
"deploy:before": "build",
"build:before": "build",
"run:before": "build"
},
"dependencies": {
"@angular/common": "2.4.8",
"@angular/compiler": "2.4.8",
"@angular/compiler-cli": "2.4.8",
"@angular/core": "2.4.8",
"@angular/forms": "2.4.8",
"@angular/http": "2.4.8",
"@angular/platform-browser": "2.4.8",
"@angular/platform-browser-dynamic": "2.4.8",
"@angular/platform-server": "2.4.8",
"@ionic-native/core": "^3.6.1",
"@ionic-native/deeplinks": "^3.6.1",
"@ionic-native/facebook": "^3.6.1",
"@ionic-native/geolocation": "^3.6.1",
"@ionic-native/google-plus": "^3.6.1",
"@ionic-native/push": "^3.6.1",
"@ionic-native/social-sharing": "^3.6.1",
"@ionic-native/splash-screen": "^3.6.1",
"@ionic-native/status-bar": "^3.6.1",
"@ionic/storage": "2.0.0",
"angular2-moment": "^1.0.0",
"bourbon": "^4.3.3",
"ionic-angular": "2.2.0",
"ionicons": "3.0.0",
"rxjs": "5.0.1",
"socket.io": "^1.7.1",
"socket.io-client": "^1.7.1",
"sw-toolbox": "3.4.0",
"zone.js": "0.7.2"
},
"devDependencies": {
"@ionic/app-scripts": "1.1.4",
"@types/googlemaps": "^3.26.1",
"@types/node": "^7.0.4",
"cordova": "6.5.0",
"ionic": "2.2.2",
"typescript": "2.0.9"
},
"cordovaPlugins": [
"cordova-plugin-device",
"cordova-plugin-console",
"cordova-plugin-whitelist",
"cordova-plugin-splashscreen",
"cordova-plugin-statusbar",
"ionic-plugin-keyboard"
],
"cordovaPlatforms": [
{
"platform": "ios",
"version": "",
"locator": "ios"
},
{
"platform": "android",
"version": "",
"locator": "android"
}
],
"description": "ion2-FullApp: An Ionic project",
"config": {
"ionic_sass": "./config/sass.config.js"
}
}