【问题标题】:NativeScriptException: Failed to find module: "stream"NativeScriptException:找不到模块:“流”
【发布时间】:2016-10-15 00:10:11
【问题描述】:

升级我的 package.json 中的一些项目后,我突然得到:

Error: com.tns.NativeScriptException: Failed to find module: "stream", relative to: /app/tns_modules/

StackTrace: 
    Frame: function:'require', file:'', line: 1, column: 266
    Frame: function:'', file:'/data/data/org.nativescript.naturesnotebookmobile/files/app/tns_modules/parse5/lib/parser/stream.js', line: 3, column: 22

有什么想法吗?以前我在 2.0.0 处理所有有角度的东西,然后它就可以工作了。这是我的 package.json:

{
  "dependencies": {
    "@angular/common": "2.1.0",
    "@angular/compiler": "2.1.0",
    "@angular/core": "2.1.0",
    "@angular/forms": "2.1.0",
    "@angular/http": "2.1.0",
    "@angular/platform-browser": "2.1.0",
    "@angular/platform-browser-dynamic": "2.1.0",
    "@angular/platform-server": "2.1.0",
    "@angular/router": "3.1.0",
    "crypto-js": "^3.1.7",
    "nativescript-angular": "1.1.0",
    ... a few other things here...
    "node-geocoder": "^3.15.0",
    "oauth-signature": "^1.3.1",
    "reflect-metadata": "^0.1.8",
    "tns-core-modules": "2.3.0",
    "util": "^0.10.3"
  },
  "devDependencies": {
    "babel-traverse": "6.16.0",
    "babel-types": "6.16.0",
    "babylon": "6.12.0",
    "lazy": "1.0.11",
    "nativescript-dev-typescript": "^0.3.2",
    "typescript": "^2.0.3",
    "zone.js": "^0.6.25"
  }
}

【问题讨论】:

    标签: nativescript angular2-nativescript


    【解决方案1】:

    nativescript-angular 的最新版本不需要@angular/platform-server 依赖。该依赖项使用了导致此问题的不同版本的 parse5。

    只需删除它。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-09-05
    • 2017-05-30
    • 1970-01-01
    • 1970-01-01
    • 2017-03-31
    • 2017-10-23
    相关资源
    最近更新 更多