2016-04-18 9 views
1

Angular2のクイックスタートアプリケーションを起動しようとしているときに問題が発生しました。Angular2 beta 15 npm start error

node -v 
5.10.1 

npm -v 
3.8.6 

私は

tsconfig.json MAC OS X上EL CAPTAINを使用しています:

{ 
    "compilerOptions": { 
    "target": "es5", 
    "module": "system", 
    "moduleResolution": "node", 
    "sourceMap": true, 
    "emitDecoratorMetadata": true, 
    "experimentalDecorators": true, 
    "removeComments": false, 
    "noImplicitAny": false 
    }, 
    "exclude": [ 
    "node_modules", 
    "typings/main", 
    "typings/main.d.ts" 
    ] 
} 

Packages.json:

{ 
    "name": "angular2-quickstart", 
    "version": "1.0.0", 
    "scripts": { 
    "start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" ", 
    "tsc": "tsc", 
    "tsc:w": "tsc -w", 
    "lite": "lite-server", 
    "typings": "typings", 
    "postinstall": "typings install" 
    }, 
    "license": "ISC", 
    "dependencies": { 
    "angular2": "2.0.0-beta.15", 
    "systemjs": "0.19.26", 
    "es6-shim": "^0.35.0", 
    "reflect-metadata": "0.1.2", 
    "rxjs": "5.0.0-beta.2", 
    "zone.js": "0.6.10" 
    }, 
    "devDependencies": { 
    "concurrently": "^2.0.0", 
    "lite-server": "^2.2.0", 
    "typescript": "^1.8.10", 
    "typings":"^0.7.12" 
    } 
} 

NPMインストール:

npm WARN lifecycle [email protected]~postinstall: cannot run in wd %s %s (wd=%s) [email protected] typings install /Users/vincentDMG/Documents/Git/angular2-tour-of-heroes 
- [email protected] node_modules/ansi-escapes 
- [email protected] node_modules/cli-width 
- [email protected] node_modules/exit-hook 
- [email protected] node_modules/figures 
- [email protected] node_modules/inquirer/node_modules/ansi-regex 
- [email protected] node_modules/inquirer/node_modules/ansi-styles 
- [email protected] node_modules/inquirer/node_modules/has-ansi 
- [email protected] node_modules/inquirer/node_modules/lodash 
- [email protected] node_modules/inquirer/node_modules/strip-ansi 
- [email protected] node_modules/inquirer/node_modules/supports-color 
- [email protected] node_modules/inquirer/node_modules/chalk 
- [email protected] node_modules/insight/node_modules/ansi-regex 
- [email protected] node_modules/insight/node_modules/ansi-styles 
- [email protected] node_modules/insight/node_modules/has-ansi 
- [email protected] node_modules/insight/node_modules/strip-ansi 
- [email protected] node_modules/insight/node_modules/supports-color 
- [email protected] node_modules/insight/node_modules/chalk 
- [email protected] node_modules/lodash._getnative 
- [email protected] node_modules/lodash.debounce 
- [email protected] node_modules/mute-stream 
- [email protected] node_modules/onetime 
- [email protected] node_modules/osx-release 
- [email protected] node_modules/readline2 
- [email protected] node_modules/restore-cursor 
- [email protected] node_modules/cli-cursor 
- [email protected] node_modules/run-async 
- [email protected] node_modules/rx-lite 
- [email protected] node_modules/through 
- [email protected] node_modules/inquirer 
[email protected] node_modules/update-notifier/node_modules/minimist -> node_modules/typings-core/node_modules/minimist 
[email protected] node_modules/typings/node_modules/mkdirp -> node_modules/typings-core/node_modules/mkdirp 
- [email protected] node_modules/typings/node_modules/mkdirp/node_modules/minimist 
- [email protected] node_modules/typings/node_modules/typescript 
- [email protected] node_modules/update-notifier/node_modules/mkdirp 
- [email protected] node_modules/update-notifier/node_modules/configstore 
- [email protected] node_modules/win-release 
- [email protected] node_modules/os-name 
- [email protected] node_modules/elegant-spinner 
- [email protected] node_modules/es6-module-loader 
- [email protected] node_modules/insight 
- [email protected] node_modules/insight/node_modules/cli-width 
- [email protected] node_modules/insight/node_modules/inquirer 
- [email protected] node_modules/insight/node_modules/lodash 
- [email protected] node_modules/log-update 
[email protected] /Users/vincentDMG/Documents/Git/angular2-tour-of-heroes 
├── [email protected] 
├── [email protected] 
└─┬ [email protected] 
    └─┬ [email protected] 
    ├── [email protected] 
    ├── [email protected] 
    ├── [email protected] 
    ├── [email protected] 
    └── [email protected] 

npm WARN [email protected] No description 
npm WARN [email protected] No repository field. 

NPM開始:

> [email protected] start /Users/vincentDMG/Documents/Git/angular2-tour-of-heroes 
> tsc && concurrently "npm run tsc:w" "npm run lite" 

typings/browser/ambient/es6-shim/es6-shim.d.ts(8,14): error TS2300: Duplicate identifier 'PropertyKey'. 
typings/browser/ambient/es6-shim/es6-shim.d.ts(11,5): error TS2300: Duplicate identifier 'done'. 
typings/browser/ambient/es6-shim/es6-shim.d.ts(12,5): error TS2300: Duplicate identifier 'value'. 
typings/browser/ambient/es6-shim/es6-shim.d.ts(250,5): error TS2300: Duplicate identifier 'EPSILON'. 
typings/browser/ambient/es6-shim/es6-shim.d.ts(285,5): error TS2300: Duplicate identifier 'MAX_SAFE_INTEGER'. 
typings/browser/ambient/es6-shim/es6-shim.d.ts(292,5): error TS2300: Duplicate identifier 'MIN_SAFE_INTEGER'. 
typings/browser/ambient/es6-shim/es6-shim.d.ts(348,5): error TS2300: Duplicate identifier 'flags'. 
typings/browser/ambient/es6-shim/es6-shim.d.ts(500,5): error TS2300: Duplicate identifier 'prototype'. 
typings/browser/ambient/es6-shim/es6-shim.d.ts(563,5): error TS2300: Duplicate identifier 'size'. 
typings/browser/ambient/es6-shim/es6-shim.d.ts(572,5): error TS2300: Duplicate identifier 'prototype'. 
typings/browser/ambient/es6-shim/es6-shim.d.ts(583,5): error TS2300: Duplicate identifier 'size'. 
typings/browser/ambient/es6-shim/es6-shim.d.ts(592,5): error TS2300: Duplicate identifier 'prototype'. 
typings/browser/ambient/es6-shim/es6-shim.d.ts(607,5): error TS2300: Duplicate identifier 'prototype'. 
typings/browser/ambient/es6-shim/es6-shim.d.ts(621,5): error TS2300: Duplicate identifier 'prototype'. 
typings/browser/ambient/es6-shim/index.d.ts(8,14): error TS2300: Duplicate identifier 'PropertyKey'. 
typings/browser/ambient/es6-shim/index.d.ts(11,5): error TS2300: Duplicate identifier 'done'. 
typings/browser/ambient/es6-shim/index.d.ts(12,5): error TS2300: Duplicate identifier 'value'. 
typings/browser/ambient/es6-shim/index.d.ts(250,5): error TS2300: Duplicate identifier 'EPSILON'. 
typings/browser/ambient/es6-shim/index.d.ts(285,5): error TS2300: Duplicate identifier 'MAX_SAFE_INTEGER'. 
typings/browser/ambient/es6-shim/index.d.ts(292,5): error TS2300: Duplicate identifier 'MIN_SAFE_INTEGER'. 
typings/browser/ambient/es6-shim/index.d.ts(348,5): error TS2300: Duplicate identifier 'flags'. 
typings/browser/ambient/es6-shim/index.d.ts(500,5): error TS2300: Duplicate identifier 'prototype'. 
typings/browser/ambient/es6-shim/index.d.ts(563,5): error TS2300: Duplicate identifier 'size'. 
typings/browser/ambient/es6-shim/index.d.ts(572,5): error TS2300: Duplicate identifier 'prototype'. 
typings/browser/ambient/es6-shim/index.d.ts(583,5): error TS2300: Duplicate identifier 'size'. 
typings/browser/ambient/es6-shim/index.d.ts(592,5): error TS2300: Duplicate identifier 'prototype'. 
typings/browser/ambient/es6-shim/index.d.ts(607,5): error TS2300: Duplicate identifier 'prototype'. 
typings/browser/ambient/es6-shim/index.d.ts(621,5): error TS2300: Duplicate identifier 'prototype'. 

npm ERR! Darwin 15.4.0 
npm ERR! argv "/usr/local/Cellar/node/5.10.1/bin/node" "/usr/local/bin/npm" "start" 
npm ERR! node v5.10.1 
npm ERR! npm v3.8.6 
npm ERR! code ELIFECYCLE 
npm ERR! [email protected] start: `tsc && concurrently "npm run tsc:w" "npm run lite" ` 
npm ERR! Exit status 2 
npm ERR! 
npm ERR! Failed at the [email protected] start script 'tsc && concurrently "npm run tsc:w" "npm run lite" '. 
npm ERR! Make sure you have the latest version of node.js and npm installed. 
npm ERR! If you do, this is most likely a problem with the angular2-quickstart package, 
npm ERR! not with npm itself. 
npm ERR! Tell the author that this fails on your system: 
npm ERR!  tsc && concurrently "npm run tsc:w" "npm run lite" 
npm ERR! You can get information on how to open an issue for this project with: 
npm ERR!  npm bugs angular2-quickstart 
npm ERR! Or if that isn't available, you can get their info via: 
npm ERR!  npm owner ls angular2-quickstart 
npm ERR! There is likely additional logging output above. 

npm ERR! Please include the following file with any support request: 
npm ERR!  /Users/vincentDMG/Documents/Git/angular2-tour-of-heroes/npm-debug.log 

私はNode.jsのとNPMの最後のバージョンを持っていると私のパッケージは、サイトangular.ioから来ています。クイックスタートの最後のバージョン。

お願いします。

ありがとうございます!

答えて

1

npm installが間違っているようです。次のエラーを参照してください。コマンドtypings installを実行しているあなたはどうする可能性が

npm WARN lifecycle [email protected]~postinstall: cannot run in wd %s %s (wd=%s) [email protected] typings install /Users/vincentDMG/Documents/Git/angular2-tour-of-heroes 

。出力は次のようになります。

> typings install 
├── es6-shim (ambient) 
└── jasmine (ambient) 
0

定義の競合があります。定義参照(/// <reference path="で始まるコメント)をチェックし、同じポリフィルを提供する異なるライブラリの定義を含めないようにしてください。

0

私は同じ問題を抱えていました。これは私のエンタープライズプロキシに関連していました。 .typingsrcファイルをプロジェクトフォルダに追加し、次のコンテンツを修正しました。

{ 
    "proxy":"http://xxx.xxx.xxx.xxx:80" 
} 

は残念ながらタイピング:。^ 1.0.4は$ HTTP_PROXYのenv VAR :( 少なくとも鉱山は私のドッカ容器内の瞬間に設定された

を使用するように思われません
関連する問題