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.
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
Depending on the configuration of your terminal, choose the following sudo
Reference link: tj/n