我目前正在构建Ionic 2-RC3应用程序。但是,由于我升级到RC-1,因此出现以下错误:(不确定它们是否保持不变,但您会明白)。

[15:16:17]  rollup: Conflicting namespaces:
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\index.js re-exports 'TextAst' from
            both
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\src\template_parser\template_ast.js
            (will be ignored) and
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\src\template_parser\template_ast.js.
[15:16:17]  rollup: Conflicting namespaces:
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\index.js re-exports 'BoundTextAst'
            from both
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\src\template_parser\template_ast.js
            (will be ignored) and
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\src\template_parser\template_ast.js.
[15:16:17]  rollup: Conflicting namespaces:
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\index.js re-exports 'AttrAst' from
            both
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\src\template_parser\template_ast.js
            (will be ignored) and
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\src\template_parser\template_ast.js.
[15:16:17]  rollup: Conflicting namespaces:
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\index.js re-exports
            'BoundElementPropertyAst' from both
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\src\template_parser\template_ast.js
            (will be ignored) and
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\src\template_parser\template_ast.js.
[15:16:17]  rollup: Conflicting namespaces:
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\index.js re-exports
            'BoundEventAst' from both
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\src\template_parser\template_ast.js
            (will be ignored) and
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\src\template_parser\template_ast.js.
[15:16:17]  rollup: Conflicting namespaces:
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\index.js re-exports 'ReferenceAst'
            from both
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\src\template_parser\template_ast.js
            (will be ignored) and
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\src\template_parser\template_ast.js.
[15:16:17]  rollup: Conflicting namespaces:
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\index.js re-exports 'VariableAst'
            from both
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\src\template_parser\template_ast.js
            (will be ignored) and
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\src\template_parser\template_ast.js.
[15:16:17]  rollup: Conflicting namespaces:
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\index.js re-exports 'ElementAst'
            from both
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\src\template_parser\template_ast.js
            (will be ignored) and
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\src\template_parser\template_ast.js.
[15:16:17]  rollup: Conflicting namespaces:
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\index.js re-exports
            'EmbeddedTemplateAst' from both
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\src\template_parser\template_ast.js
            (will be ignored) and
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\src\template_parser\template_ast.js.
[15:16:17]  rollup: Conflicting namespaces:
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\index.js re-exports
            'BoundDirectivePropertyAst' from both
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\src\template_parser\template_ast.js
            (will be ignored) and
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\src\template_parser\template_ast.js.
[15:16:17]  rollup: Conflicting namespaces:
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\index.js re-exports 'DirectiveAst'
            from both
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\src\template_parser\template_ast.js
            (will be ignored) and
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\src\template_parser\template_ast.js.
[15:16:17]  rollup: Conflicting namespaces:
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\index.js re-exports 'ProviderAst'
            from both
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\src\template_parser\template_ast.js
            (will be ignored) and
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\src\template_parser\template_ast.js.
[15:16:17]  rollup: Conflicting namespaces:
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\index.js re-exports
            'ProviderAstType' from both
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\src\template_parser\template_ast.js
            (will be ignored) and
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\src\template_parser\template_ast.js.
[15:16:17]  rollup: Conflicting namespaces:
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\index.js re-exports 'NgContentAst'
            from both
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\src\template_parser\template_ast.js
            (will be ignored) and
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\src\template_parser\template_ast.js.
[15:16:17]  rollup: Conflicting namespaces:
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\index.js re-exports
            'PropertyBindingType' from both
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\src\template_parser\template_ast.js
            (will be ignored) and
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\src\template_parser\template_ast.js.
[15:16:17]  rollup: Conflicting namespaces:
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\index.js re-exports
            'templateVisitAll' from both
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\src\template_parser\template_ast.js
            (will be ignored) and
            C:\Users\Ivar\documents\ionic2-boilerplate\node_modules\@angular\compiler\src\template_parser\template_ast.js.

package.json
{
  "name": "ionic2-boilerplate",
  "author": "Quintor",
  "version": "0.2.0",
  "keywords": [
    "ionic2",
    "angular2",
    "rollup",
    "typescript",
    "karma"
  ],
  "engines": {
    "node": ">= 6.6.0",
    "npm": ">= 3"
  },
  "scripts": {
    "dev": "bnr dev",
    "build": "bnr build",
    "test": "bnr test",
    "pree2e": "cd www && python -m SimpleHTTPServer 8090 >> ../python_serve.log 2>&1 &",
    "e2e": "protractor config/protractor.conf.js",
    "pree2e:interactive": "npm run pree2e",
    "e2e:interactive": "protractor config/protractor.conf.js --elementExplorer",
    "watch": "ionic-app-scripts watch",
    "serve:before": "watch",
    "emulate:before": "build",
    "deploy:before": "build",
    "build:before": "build",
    "run:before": "build --dev",
    "ios:dev": "bnr ios:dev",
    "ios:release": "bnr ios:release",
    "android:dev": "bnr android:dev",
    "android:release": "bnr android:release",
    "commit": "git-cz",
    "release": "standard-version --no-verify",
    "push": "git push --follow-tags origin master",
    "lint": "tslint \"src/**/*.ts\" --exclude=src/**/*.d.ts",
    "scss-lint": "scss-lint",
    "docs": "typedoc --options typedoc.json --exclude '**/*.spec.ts' ./src/",
    "outdated": "npm outdated --depth 0",
    "postinstall": "webdriver-manager update --chrome"
  },
  "betterScripts": {
    "dev": {
      "command": "ionic serve",
      "env": {
        "NODE_ENV": "development",
        "PLATFORM": "web"
      }
    },
    "build": {
      "command": "ionic-app-scripts build",
      "env": {
        "NODE_ENV": "production",
        "PLATFORM": "web"
      }
    },
    "test": {
      "command": "karma start ./config/karma.conf.js",
      "env": {
        "NODE_ENV": "test"
      }
    },
    "ios:dev": {
      "command": "ionic run ios --livereload",
      "env": {
        "NODE_ENV": "development",
        "PLATFORM": "ios"
      }
    },
    "ios:release": {
      "command": "npm run build && ionic build ios",
      "env": {
        "NODE_ENV": "production",
        "PLATFORM": "ios"
      }
    },
    "android:dev": {
      "command": "ionic run android --livereload",
      "env": {
        "NODE_ENV": "development",
        "PLATFORM": "android"
      }
    },
    "android:release": {
      "command": "npm run build && ionic build android",
      "env": {
        "NODE_ENV": "production",
        "PLATFORM": "android"
      }
    }
  },
  "dependencies": {
    "@angular/common": "2.1.1",
    "@angular/compiler": "2.1.1",
    "@angular/compiler-cli": "2.1.1",
    "@angular/core": "2.1.1",
    "@angular/forms": "2.1.1",
    "@angular/http": "2.1.1",
    "@angular/platform-browser": "2.1.1",
    "@angular/platform-browser-dynamic": "2.1.1",
    "@angular/platform-server": "2.1.1",
    "@ionic/storage": "1.1.6",
    "ionic-angular": "2.0.0-rc.3",
    "ionic-native": "2.2.3",
    "ionicons": "3.0.0",
    "rxjs": "5.0.0-beta.12",
    "zone.js": "0.6.26",
    "lz-string": "^1.4.4",
    "ng2-charts": "^1.4.1"
  },
  "devDependencies": {
    "@ionic/app-scripts": "0.0.46",
    "@types/jasmine": "2.2.34",
    "@types/lodash": "^4.14.36",
    "better-npm-run": "0.0.11",
    "codelyzer": "^1.0.0-beta.0",
    "commitizen": "^2.8.6",
    "cz-conventional-changelog": "^1.2.0",
    "ghooks": "^1.3.2",
    "jasmine-core": "2.5.2",
    "jasmine-spec-reporter": "^2.7.0",
    "karma": "1.3.0",
    "karma-chrome-launcher": "2.0.0",
    "karma-coverage": "^1.1.1",
    "karma-jasmine": "1.0.2",
    "karma-phantomjs-launcher": "^1.0.2",
    "karma-rollup-plugin": "^0.2.4",
    "karma-sourcemap-loader": "^0.3.7",
    "karma-spec-reporter": "0.0.26",
    "phantomjs-prebuilt": "^2.1.12",
    "protractor": "^4.0.9",
    "protractor-jasmine2-screenshot-reporter": "^0.3.2",
    "rollup-plugin-alias": "^1.2.0",
    "rollup-plugin-angular": "^0.4.2",
    "rollup-plugin-buble": "^0.14.0",
    "rollup-plugin-commonjs": "^5.0.4",
    "rollup-plugin-node-resolve": "^2.0.0",
    "rollup-plugin-replace": "^1.1.1",
    "rollup-plugin-typescript": "^0.8.1",
    "standard-version": "^2.2.1",
    "ts-helpers": "^1.1.1",
    "ts-node": "^1.3.0",
    "typedoc": "^0.4.5",
    "typescript": "^2.0.3",
    "validate-commit-msg": "^2.8.0"
  },
  "config": {
    "commitizen": {
      "path": "./node_modules/cz-conventional-changelog"
    },
    "ionic_rollup": "./config/rollup.config.js"
  },
  "description": "ionic2-boilerplate: An Ionic project",
  "cordovaPlugins": [
    "cordova-plugin-device",
    "cordova-plugin-console",
    "cordova-plugin-whitelist",
    "cordova-plugin-splashscreen",
    "cordova-plugin-statusbar",
    "ionic-plugin-keyboard",
    {
      "variables": {
        "SENDER_ID": "123456789 1337"
      },
      "locator": "phonegap-plugin-push",
      "id": "phonegap-plugin-push"
    }
  ],
  "cordovaPlatforms": [],
  "license": "MIT"
}

现在我的问题是,是什么线导致了这种情况,为什么会发生呢?因为对我来说,我的package.json中似乎没有重复的值。
rm -rf node_modules && npm install无法解决此问题。

最佳答案

rollup.config.js可能有问题
Default ionic rollup config
还要检查Third party module exports here
你可以:

如果您有自定义设置,请从那里开始,尽管需要一些返工。
希望能帮助到你。

关于angular - 汇总-冲突的 namespace ,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/40766996/

10-15 21:32