Wasyster
Wasyster

Reputation: 2535

NativeScript TypeError: Cannot read property 'version' of undefined

We are building a NativeScript application and it stopped starting wiht the following error:

Processing node_modules failed. TypeError: Cannot read property 'version' of undefined

nodejs version is 6.10, and the same error are on 7.6

Package.json

{
  "description": "Mapporia",
  "version": "0.0.1",
  "author": "PanonicIT",
  "license": "SEE LICENSE IN <your-license-filename>",
  "readme": "Mapporia",

  "dependencies": {
    "@angular/common": "2.4.3",
    "@angular/compiler": "2.4.3",
    "@angular/core": "2.4.3",
    "@angular/forms": "2.4.3",
    "@angular/http": "2.4.3",
    "@angular/platform-browser": "2.4.3",
    "@angular/platform-browser-dynamic": "2.4.3",
    "@angular/router": "3.4.3",
    "crypto-js": "^3.1.9-1",
    "email-validator": "^1.0.7",
    "nativescript-angular": "1.4.0",
    "nativescript-oauth": "^1.3.0",
    "nativescript-theme-core": "~1.0.2",
    "reflect-metadata": "~0.1.8",
    "rxjs": "~5.0.1",
    "tns-core-modules": "2.5.1"
  },
  "devDependencies": {
    "nativescript-dev-android-snapshot": "^0.*.*",
    "nativescript-dev-typescript": "~0.3.5",
    "typescript": "~2.1.0",
    "zone.js": "~0.7.2"
  }
}

Any idea? thnx

Upvotes: 3

Views: 1462

Answers (1)

marcan2020
marcan2020

Reputation: 609

I had the same problem, when I add a new nativescript plugin to my project:

Successfully installed plugin nativescript-screen-orientation.
TypeError: Cannot read property 'version' of undefined

Like @wasyster said in his comment, removing android platform solve the problem:

tns platform remove android
tns platform add android

Upvotes: 3

Related Questions