2016-03-05 43 views
7

角度2のプロジェクトを実行しようとしています。 package.jsonがあります:'concurently'は内部または外部のコマンド、操作可能なプログラムまたはバッチファイルとして認識されません

{ 
    "name": "angular2-quickstart", 
    "version": "1.0.0", 
    "scripts": { 
    "start": "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.7", 
    "systemjs": "0.19.22", 
    "es6-promise": "^3.0.2", 
    "es6-shim": "^0.33.3", 
    "reflect-metadata": "0.1.2", 
    "rxjs": "5.0.0-beta.2", 
    "zone.js": "0.5.15" 
    }, 
    "devDependencies": { 
    "concurrently": "^2.0.0", 
    "lite-server": "^2.1.0", 
    "typescript": "^1.8.2", 
    "typings":"^0.6.8" 
    } 
} 

は、私が実行します。

npm start 

と私が取得:

npm install -g concurrently 

をしても、私はエラーを得た:

npm WARN package.json [email protected] No README.md file found! 

> [email protected] start E:\other\dropbox\Dropbox\programavimas\kodo pavyzdziai\htdocs\angular_2\egghead 
> concurrently "npm run tsc:w" "npm run lite" 

'concurrently' is not recognized as an internal or external command, 
operable program or batch file. 
npm ERR! [email protected] start: `concurrently "npm run tsc:w" "npm run lite" ` 
npm ERR! `cmd "/c" "concurrently \"npm run tsc:w\" \"npm run lite\" "` failed with 1 
npm ERR! 
npm ERR! Failed at the [email protected] start script. 
npm ERR! 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!  concurrently "npm run tsc:w" "npm run lite" 
npm ERR! You can get their info via: 
npm ERR!  npm owner ls angular2-quickstart 
npm ERR! There is likely additional logging output above. 

npm ERR! System Windows_NT 6.1.7601 
npm ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start" 
npm ERR! cwd E:\other\dropbox\Dropbox\programavimas\kodo pavyzdziai\htdocs\angular_2\egghead 
npm ERR! node -v v0.8.9 
npm ERR! npm -v 1.1.61 
npm ERR! code ELIFECYCLE 
npm 

私も試してみました:

npm http GET https://registry.npmjs.org/concurrently 
npm http 304 https://registry.npmjs.org/concurrently 
npm http GET https://registry.npmjs.org/concurrently/-/concurrently-2.0.0.tgz 
npm http 200 https://registry.npmjs.org/concurrently/-/concurrently-2.0.0.tgz 
npm http GET https://registry.npmjs.org/bluebird/2.9.6 
npm http GET https://registry.npmjs.org/chalk/0.5.1 
npm http GET https://registry.npmjs.org/commander/2.6.0 
npm http GET https://registry.npmjs.org/cross-spawn 
npm http GET https://registry.npmjs.org/lodash/3.1.0 
npm http GET https://registry.npmjs.org/moment 
npm http GET https://registry.npmjs.org/rx/2.3.24 
npm http 200 https://registry.npmjs.org/cross-spawn 
npm ERR! Error: No compatible version found: [email protected]'^0.2.9' 
npm ERR! Valid install targets: 
npm ERR! ["0.1.0","0.1.1","0.1.2","0.1.3","0.1.4","0.1.5","0.1.6","0.1.7","0.2.0","0.2.1","0.2.2","0.2.3","0.2.4","0.2.5","0.2.6","0.2.7","0.2.8","0.2.9","0.3.0","0.4.0","0.4.1","1.0.0","1.0.1","1.0.2","1.0.3","1.0.4","2.0.0","2.0.1","2.1.0","2.1.1","2.1.2","2.1.3","2.1.4","2.1.5"] 
npm ERR!  at installTargetsError (C:\Program Files\nodejs\node_modules\npm\lib\cache.js:553:10) 
npm ERR!  at C:\Program Files\nodejs\node_modules\npm\lib\cache.js:477:15 
npm ERR!  at saved (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-registry-client\lib\get.js:138:7) 
npm ERR!  at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:220:7 
npm ERR!  at Object.oncomplete (fs.js:297:15) 
npm ERR! If you need help, you may report this log at: 
npm ERR!  <http://github.com/isaacs/npm/issues> 
npm ERR! or email it to: 
npm ERR!  <[email protected]> 

npm ERR! System Windows_NT 6.1.7601 
npm ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "concurrently" 
npm ERR! cwd E:\other\dropbox\Dropbox\programavimas\kodo pavyzdziai\htdocs\angular_2\egghead 
npm ERR! node -v v0.8.9 
npm ERR! npm -v 1.1.61 
npm http 200 https://registry.npmjs.org/moment 
npm http 200 https://registry.npmjs.org/commander/2.6.0 
npm http GET https://registry.npmjs.org/commander/-/commander-2.6.0.tgz 
npm http 200 https://registry.npmjs.org/chalk/0.5.1 
npm http GET https://registry.npmjs.org/chalk/-/chalk-0.5.1.tgz 
npm http 200 https://registry.npmjs.org/bluebird/2.9.6 
npm http GET https://registry.npmjs.org/bluebird/-/bluebird-2.9.6.tgz 
npm http 200 https://registry.npmjs.org/commander/-/commander-2.6.0.tgz 
npm http 200 https://registry.npmjs.org/chalk/-/chalk-0.5.1.tgz 
npm http 200 https://registry.npmjs.org/bluebird/-/bluebird-2.9.6.tgz 
npm http 200 https://registry.npmjs.org/rx/2.3.24 
npm http 200 https://registry.npmjs.org/lodash/3.1.0 
npm http GET https://registry.npmjs.org/lodash/-/lodash-3.1.0.tgz 
npm http GET https://registry.npmjs.org/rx/-/rx-2.3.24.tgz 
npm http 200 https://registry.npmjs.org/lodash/-/lodash-3.1.0.tgz 
npm http 200 https://registry.npmjs.org/rx/-/rx-2.3.24.tgz 
npm 

多分私はノードの古いバージョンを実行しています。私はアップグレードしよう:

npm install -g npm 

し、再び、私はエラーを取得:

npm http GET https://registry.npmjs.org/npm 
npm http 304 https://registry.npmjs.org/npm 
npm http GET https://registry.npmjs.org/npm/-/npm-3.8.0.tgz 
npm http 200 https://registry.npmjs.org/npm/-/npm-3.8.0.tgz 
npm ERR! tar pack Error reading C:\cygwin\tmp\npm-6108\1457164431986-0.6791366613470018\package 
npm ERR! TypeError: Cannot call method 'filter' of undefined 
npm ERR!  at Packer.IgnoreReader.addIgnoreRules (C:\Program Files\nodejs\node_modules\npm\node_modules\fstream-npm\node_modules\fstream-ignore\ignore.js:148:13) 
npm ERR!  at Packer.IgnoreReader.addIgnoreFile (C:\Program Files\nodejs\node_modules\npm\node_modules\fstream-npm\node_modules\fstream-ignore\ignore.js:133:10) 
npm ERR!  at fs.readFile (fs.js:176:14) 
npm ERR!  at fs.close (C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:92:5) 
npm ERR!  at Object.oncomplete (fs.js:297:15) 
npm ERR! If you need help, you may report this log at: 
npm ERR!  <http://github.com/isaacs/npm/issues> 
npm ERR! or email it to: 
npm ERR!  <[email protected]> 

npm ERR! System Windows_NT 6.1.7601 
npm ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "npm" 
npm ERR! cwd E:\other\dropbox\Dropbox\programavimas\kodo pavyzdziai\htdocs\angular_2\egghead 
npm ERR! node -v v0.8.9 
npm ERR! npm -v 1.1.61 
npm ERR! type non_object_property_call 
npm ERR! addLocalDirectory Could not pack "C:\\cygwin\\tmp\\npm-6108\\1457164431986-0.6791366613470018\\package" to "C:\\Users\\Darius\\AppData\\Roaming\\npm-cache\\npm\\3.8.0\\package.tgz" 
npm ERR! SyntaxError: Unexpected end of input 
npm ERR!  at Object.parse (native) 
npm ERR!  at Packer.readRules (C:\Program Files\nodejs\node_modules\npm\node_modules\fstream-npm\fstream-npm.js:189:33) 
npm ERR!  at Packer.IgnoreReader.addIgnoreFile (C:\Program Files\nodejs\node_modules\npm\node_modules\fstream-npm\node_modules\fstream-ignore\ignore.js:132:22) 
npm ERR!  at fs.readFile (fs.js:176:14) 
npm ERR!  at fs.close (C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:92:5) 
npm ERR!  at Object.oncomplete (fs.js:297:15) 
npm ERR! If you need help, you may report this log at: 
npm ERR!  <http://github.com/isaacs/npm/issues> 
npm ERR! or email it to: 
npm ERR!  <[email protected]> 

npm ERR! System Windows_NT 6.1.7601 
npm ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "npm" 
npm ERR! cwd E:\other\dropbox\Dropbox\programavimas\kodo pavyzdziai\htdocs\angular_2\egghead 
npm ERR! node -v v0.8.9 
npm ERR! npm -v 1.1.61 
npm ERR! file C:\cygwin\tmp\npm-6108\1457164431986-0.6791366613470018\package\node_modules\read-package-tree\test\fixtures\bad\package.json 
npm ERR! path C:\cygwin\tmp\npm-6108\1457164431986-0.6791366613470018\package\node_modules\read-package-tree\test\fixtures\bad 
npm ERR! type unexpected_eos 
npm ERR! fstream_path C:\cygwin\tmp\npm-6108\1457164431986-0.6791366613470018\package\node_modules\read-package-tree\test\fixtures\bad 
npm ERR! fstream_type Directory 
npm ERR! fstream_class Packer 
npm ERR! fstream_stack Packer.readRules (C:\Program Files\nodejs\node_modules\npm\node_modules\fstream-npm\fstream-npm.js:192:10) 
npm ERR! fstream_stack Packer.IgnoreReader.addIgnoreFile (C:\Program Files\nodejs\node_modules\npm\node_modules\fstream-npm\node_modules\fstream-ignore\ignore.js:132:22) 
npm ERR! fstream_stack fs.readFile (fs.js:176:14) 
npm ERR! fstream_stack fs.close (C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:92:5) 
npm ERR! fstream_stack Object.oncomplete (fs.js:297:15) 
npm 

それを修正する方法は?私はここに何を追加するか分からない。

+0

てCMDを実行する上であなたは-g concurrently' – rgvassar

+0

@rgvassarをインストールsudoのNPM '実行する必要があり、私のために働いた - 私はCygwinを使用してWindowsの午前 –

+2

あなたのnpmバージョンは古いです。 [npm-windows-upgrade](https://github.com/felixrieseberg/npm-windows-upgrade)を試してみてください。「npm install -g npm-windows-upgrade」を実行してからnpm-windows-upgrade – Abdulrahman

答えて

13

rgvassarのコメントの後、私はチョコレートをチェックしようとしました。

https://chocolatey.org/packages?q=npm

しかし、私はまた、NPMがnodejsが付属していることを見た:私は、NPMがここに廃止されているのを見ました。そこでnodejをアップグレードすることにしました。 nodejのアップグレード後、npmもアップグレードされていることが分かりました。

は、その後、私は管理者としてCMDに走った:私はNPMはcygwinの上でサポートされていないにも見

npm install -g concurrently 

。しかしcygwinもWindowsのcmdコマンドにアクセスすることができるので、CMDにインストールするだけで十分です。

これは正常にインストールされましたが、現在はこのエラーは発生しません。

ありがとう、特に素早いコメントがあります。

+1

あなたはそれを世界的に必要としないかもしれません。私が必要としていたのは「npm install」のoopsだったプロジェクトに取り組んでいました – Jackie

0
npm install -g npm-windows-upgrade 
npm install -g concurrently 

これは、Linuxを使っている場合は、管理

関連する問題