2016-03-05 17 views
7

Tôi cố gắng chạy dự án góc 2. Có package.json:'đồng thời' không được nhận dạng dưới dạng lệnh nội bộ hoặc bên ngoài, chương trình có thể hoạt động hoặc tệp lô

{ 
    "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" 
    } 
} 

tôi chạy:

npm start 

và tôi nhận được:

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 

Tôi cũng đã cố gắng:

npm install -g concurrently 

và tôi cũng đã nhận lỗi :

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 

Có lẽ tôi đang chạy phiên bản cũ của nút. Tôi cố gắng để nâng cấp:

npm install -g npm 

và một lần nữa tôi nhận được lỗi:

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 

Làm thế nào để khắc phục điều đó? Tôi không biết thêm thông tin gì để thêm vào đây.

+0

Nếu bạn đang ở trên Linux bạn có thể cần phải chạy sudo NPM cài đặt -g concurrently' – rgvassar

+0

@rgvassar - Tôi đang trên cửa sổ sử dụng Cygwin –

+2

Phiên bản npm của bạn cũ. thử [npm-windows-upgrade] (https://github.com/felixrieseberg/npm-windows-upgrade) .. chỉ cần chạy 'npm install -g npm-windows-upgrade', sau đó npm-windows-upgrade – Abdulrahman

Trả lời

13

Sau khi nhận xét rgvassar, tôi đã thử kiểm tra sô cô la. Tôi thấy rằng NPM bị phản đối ở đây:

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

Nhưng tôi cũng thấy rằng NPM đi kèm với nodejs. Vì vậy, tôi quyết định nâng cấp nodejs. Sau khi nâng cấp các nút, tôi thấy rằng npm cũng được nâng cấp.

Sau đó, tôi chạy trong CMD như admin:

npm install -g concurrently 

Tôi cũng thấy NPM mà không được hỗ trợ trên Cygwin. Nhưng kể từ khi Cygwin cũng có thể truy cập cửa sổ lệnh cmd, tôi vẫn có thể sử dụng trên nó như tôi hiểu, chỉ cần làm cài đặt trên CMD.

Nó đã được cài đặt thành công và bây giờ không ném lỗi này nữa.

Cảm ơn rất nhiều, đặc biệt là để nhận xét nhanh!

+1

Bạn thậm chí có thể không cần nó trên toàn cầu. Tôi đang làm việc trên một dự án mà tất cả những gì tôi cần là một 'npm install' oops – Jackie

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

này đã làm việc cho tôi, trên chạy cmd thông qua quản trị

Các vấn đề liên quan

 Các vấn đề liên quan