Pakej tutorial Angular2 - Editor Wira, semasa persekitaran mula dibina, ralat berlaku yang menaip tidak dapat dipasang.
Pakej yang sama boleh digunakan seperti biasa dalam kedua-dua persekitaran Windows dan Mac tanpa sebarang masalah.
Alamat pakej:
angular2-tour-of-heroes
Di bawah Ubuntu, versi Nodejs dinaik taraf kepada 6.8.0 dan versi npm ialah 3.10.8.
Jalankan di bawah pakej
Laporkan ralat dan mesej ralat
$ npm install
npm WARN deprecated tough-cookie@2.2.2: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130
> angular2-tour-of-heroes@1.0.0 postinstall /home/xiaofuyesnew/workspace/angular2-tour-of-heroes
> typings install
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.0.14: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN angular2-tour-of-heroes@1.0.0 No repository field.
npm ERR! Linux 4.4.0-42-generic
npm ERR! argv "/usr/local/n/versions/node/6.8.0/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v6.8.0
npm ERR! npm v3.10.8
npm ERR! file sh
npm ERR! path sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn sh
npm ERR! angular2-tour-of-heroes@1.0.0 postinstall: `typings install`
npm ERR! spawn sh ENOENT
npm ERR!
npm ERR! Failed at the angular2-tour-of-heroes@1.0.0 postinstall script 'typings install'.
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-tour-of-heroes package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! typings install
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs angular2-tour-of-heroes
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls angular2-tour-of-heroes
npm ERR! There is likely additional logging output above.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.0.14: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN angular2-tour-of-heroes@1.0.0 No repository field.
npm ERR! Linux 4.4.0-42-generic
npm ERR! argv "/usr/local/n/versions/node/6.8.0/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v6.8.0
npm ERR! npm v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! angular2-tour-of-heroes@1.0.0 postinstall: `typings install`
npm ERR! Exit status -2
npm ERR!
npm ERR! Failed at the angular2-tour-of-heroes@1.0.0 postinstall script 'typings install'.
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-tour-of-heroes package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! typings install
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs angular2-tour-of-heroes
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls angular2-tour-of-heroes
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/xiaofuyesnew/workspace/angular2-tour-of-heroes/npm-debug.log
Sudah mencuba npm install typings -g
, tetapi ralat tetap ada.
Adalah lebih baik untuk melakukannya sendiri Sebab utama ialah NPM, kerana n digunakan untuk mengurus versi nodejs, dan apabila n menguruskan versi nod, ia juga bergantung pada nod, jadi kadangkala beberapa masalah akan berlaku. , saya pergi untuk mencari halaman keluaran n tj master Disebutkan di atas bahawa selepas menggunakan n untuk menukar versi, hubungan antara nod dan npm perlu dibaiki, jika tidak, npm mungkin menghadapi masalah.
Selepas menggunakan n untuk menukar versi, anda perlu menjalankan skrip berikut untuk membaiki npm
Bergantung pada konfigurasi terminal anda, pilih sudo berikut
Pautan rujukan: tj/n