angular.js - Angular2 tutorial package typings cannot be installed.
迷茫
迷茫 2017-05-15 17:07:42
0
1
769

Angular2 tutorial package - Hero Editor, when the environment was first built, an error occurred that typings could not be installed.
The same package can be used normally in both Windows and Mac environments without any problems.
Package address:
angular2-tour-of-heroes

Under Ubuntu, the Nodejs version is upgraded to 6.8.0, and the npm version is 3.10.8.

Run under the package
Report error and error message

$ 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

Already tried npm install typings -g, but the error remains.

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(1)
滿天的星座

It’s better to do it yourself. The main reason is NPM, because n is used to manage the nodejs version. npm relies on nodejs, and when n manages the node version, it also depends on node, so sometimes some problems will occur. , I went to find the n release page of tj master. It is mentioned above that after using n to switch versions, the relationship between node and npm needs to be repaired, otherwise npm is likely to have problems.
After using n to switch versions, you need to run the following script to repair npm

$ curl -0 -L https://npmjs.org/install.sh | sudo sh

Depending on the configuration of your terminal, choose the following sudo

Reference link: tj/n

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template