Error at ionic serve


#1

Hi,
I’m a newbie in ionic framework, please help
[ERROR]: The package.json file seems malformed.

In package.json is valid json format which I was checked in jsonlint.com


#2

How did you create your package.json did you change anything?
Can you show it to us?
What is your ionic info output on the console?


#3

Sure,

Ionic info:

 cli packages: (/home/prasad/Ionic Projects/MyDoc-Ionic/node_modules)

    @ionic/cli-utils  : 1.13.0
    ionic (Ionic CLI) : 3.13.0

global packages:

    cordova (Cordova CLI) : 7.0.1 

local packages:

    @ionic/app-scripts : 2.0.2
    Cordova Platforms  : android 6.3.0
    Ionic Framework    : ionic-angular 3.5.3

System:

    Android SDK Tools : 26.1.1
    Node              : v8.6.0
    npm               : 5.3.0 
    OS                : Linux 4.10

Misc:

    backend : pro

package.json:

{
    "homepage": "https://www.google.com",
    "version": "0.0.1",
    "private": true,
    "scripts": {
        "clean": "ionic-app-scripts clean",
        "build": "ionic-app-scripts build",
        "lint": "ionic-app-scripts lint",
        "ionic:build": "ionic-app-scripts build",
        "ionic:serve": "ionic-app-scripts serve"
    },
    "dependencies": {
        "@angular/common": "4.1.3",
        "@angular/compiler": "4.1.3",
        "@angular/compiler-cli": "4.1.3",
        "@angular/core": "4.1.3",
        "@angular/forms": "4.1.3",
        "@angular/http": "4.1.3",
        "@angular/platform-browser": "4.1.3",
        "@angular/platform-browser-dynamic": "4.1.3",
        "@ionic-native/camera": "^4.1.0",
        "@ionic-native/core": "3.12.1",
        "@ionic-native/splash-screen": "3.12.1",
        "@ionic-native/status-bar": "3.12.1",
        "@ionic/storage": "2.0.1",
        "cordova-android": "^6.2.3",
		"cordova-plugin-camera": "^2.4.1",
        "cordova-plugin-compat": "^1.1.0",
        "cordova-plugin-console": "^1.0.5",
        "cordova-plugin-device": "^1.1.4",
        "cordova-plugin-splashscreen": "^4.0.3",
        "cordova-plugin-statusbar": "^2.2.2",
        "cordova-plugin-whitelist": "^1.3.1",
        "ionic-angular": "3.5.3",
        "ionic-img-viewer": "^2.4.0",        "rxjs": "5.4.0",
        "sw-toolbox": "3.6.0",
        "zone.js": "0.8.12"    },
    "devDependencies": {
		"@ionic/app-scripts": "2.0.2",
        "@ionic/cli-plugin-cordova": "1.6.2",
        "@ionic/cli-plugin-ionic-angular": "1.4.0",
        "ionic": "3.7.0",
        "typescript": "2.3.4"    },
    "description": "MyDriver: An Application for IMC Drivers",
    "cordova": {
        "plugins": {
            "cordova-plugin-statusbar": {},
            "cordova-plugin-splashscreen": {},
            "cordova-plugin-camera": {},
            "cordova-plugin-console": {},
            "cordova-plugin-device": {},
            "cordova-plugin-splashscreen": {},
            "cordova-plugin-statusbar": {},
            "cordova-plugin-whitelist": {},
            "ionic-plugin-keyboard": {},
            "cordova-plugin-datepicker": {},
            "cordova-plugin-camera": {},
            "ionic-plugin-keyboard": {}
        },
        "platforms": [
            "android"
        ]
    }
}

#4

Your package.json is missing 2 keys/attributes. ‘name’ and ‘author’.

In to of package.json at the root(base level), add ‘name’ key like "name": "My_App_Name",.
Also at same base level add "author": "YourName",.


#5

Really old. You should update this.


#6

Thanks, I added those keys and i also updated the @ionic/app-scrpts: 2.0.2 to 3.0.0
Its Cleared.


#7

Open a new topic for this please.