首页 文章

NativeScript TypeError:无法读取未定义的属性'version'

提问于
浏览
2

我们正在构建一个NativeScript应用程序,并且它因以下错误而停止启动:

处理node_modules失败 . TypeError:无法读取未定义的属性“version”

nodejs版本是6.10,同样的错误是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"
  }
}

任何的想法?日Thnx

1 回答

  • 1

    当我向项目中添加一个新的nativescript插件时,我遇到了同样的问题:

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

    就像@wasyster在评论中说的,删除android平台解决了这个问题:

    tns platform remove android
    tns platform add android
    

相关问题