D
D
Denis2016-02-16 20:11:26
Angular
Denis, 2016-02-16 20:11:26

How to overcome the error when starting the angular server?

I ran into such a problem: when I try to at least start going through the https://docs.angularjs.org/tutorial tutorial , my server gives an error. I do everything step by step: first "git clone --depth=14 https://github.com/angular/angular-phonecat.git ", then "npm install" and then "npm start". Everything seems to be working fine:

D:\Web dev\AngularJS learning\angular-phonecat>npm start
> [email protected] prestart D:\Web dev\AngularJS learning\angular-phonecat
> npm install
> [email protected] postinstall D: \Web dev\AngularJS learning\angular-phonecat
> bower install
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: [email protected]
> [email protected] start D:\Web dev\AngularJS learning\angular-phonecat
> http-server -a 0.0.0.0 -p 8000
Starting up http-server, serving ./ on port: 8000

But when I try to go to " localhost:8000/app/index.html " the server gives me an error that I can't understand, much less solve.
[Tue, 16 Feb 2016 16:59:59 GMT] "GET /app/index.html" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:44.0) Gecko/20100101
Firefox/44.0"
_http_outgoing.js:348
throw new TypeError('The header content contains invalid characters');
^
TypeError: The header content contains invalid characters
at ServerResponse.OutgoingMessage.setHeader (_http_outgoing.js:348:11)
at ResponseStream.(anonymous function) [as setHeader] (D:\Web dev\AngularJS learning\angular-phonecat\node_modul
es\union\lib\response-stream.js:86:34)
at serve (D:\Web dev\AngularJS learning\angular-phonecat\node_modules\ecstatic\lib\ecstatic.js:146:11)
at D:\Web dev\AngularJS learning\angular-phonecat\node_modules\ecstatic\lib\ecstatic.js:139:9
at FSReqWrap.oncomplete (fs.js:82:15)
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js"
"start"
npm ERR! node v5.6.0
npm ERR! npm v3.6.0
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: `http-server -a 0.0.0.0 -p 8000`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'http-server -a 0.0.0.0 -p 8000'.
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 angular-phonecat package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! http-server -a 0.0.0.0 -p 8000
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs angular-phonecat
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls angular-phonecat
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! D:\Web dev\AngularJS learning\angular-phonecat\npm-debug.log

As I understand it, the error is either in the old node (I have v5.6.0), or in npm (it costs 3.6.0), or in the package, but I take it from the office. site.
In general, a complete dead end. I start through the WebStorm'a console if it matters.
Please help me, I'll provide a plus in karma :)
PS I tried to google, but I didn't find anything. Before that, there were still errors with an uninstalled python and with cl.exe, a cat. I successfully solved the installation acc. programs. And here I don't really know what to do.
UPD. When installing 'npm i' gives a long series of the same type of errors, the beginning was screened:
https://gyazo.com/4b1605a22b7a499bf9e2d6f0803c86d4

(this problem was solved by updating all modules to the latest versions)

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
MNB, 2016-02-16
@SvDenys

try another webserver. their blessings are like dirt. light-http for example

A
Arthur O'Damny, 2016-02-16
@Damny

It seems to me that the problem is really in the node, since it says: npm WARN notsup Not compatible with your operating system or architecture: [email protected]
Since you have Windows, download the installer from the node's site.

P
pomeo, 2016-02-16
@pomeo

it also says https://github.com/angular/angular-phonecat/issues/303
you need to go to package.json and change the http-server version to 0.8.5

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question