andrey@DESKTOP-5UVHVST MINGW64 /d/code/js/phone/angular-phonecat (master) $ npm start > angular-phonecat@0.0.0 prestart D:\code\js\phone\angular-phonecat > npm install > angular-phonecat@0.0.0 postinstall D:\code\js\phone\angular-phonecat > bower install > angular-phonecat@0.0.0 start D:\code\js\phone\angular-phonecat > http-server -a 0.0.0.0 -p 8000 Starting up http-server, serving ./ on port: 8000 Hit CTRL-C to stop the server [Wed, 13 Apr 2016 09:33:51 GMT] "GET /" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.112 Safari/537.36" _http_outgoing.js:351 throw new TypeError('The header content contains invalid characters'); ^ TypeError: The header content contains invalid characters at ServerResponse.OutgoingMessage.setHeader (_http_outgoing.js:351:13) at ResponseStream.(anonymous function) [as setHeader] (D:\CODE\JS\phone\angular-phonecat\node_modules\http-server\node_modules\union\lib\response-stream.js:86:34) at D:\CODE\JS\phone\angular-phonecat\node_modules\http-server\node_modules\ecstatic\lib\ecstatic\showdir.js:42:13 at FSReqWrap.oncomplete (fs.js:82:15) npm ERR! Windows_NT 10.0.10586 npm ERR! argv "D:\\Program Files\\nodejs\\node.exe" "D:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start" npm ERR! node v4.4.3 npm ERR! npm v2.15.1 npm ERR! code ELIFECYCLE npm ERR! angular-phonecat@0.0.0 start: `http-server -a 0.0.0.0 -p 8000` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the angular-phonecat@0.0.0 start script 'http-server -a 0.0.0.0 -p 8000'. npm ERR! 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 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:\code\js\phone\angular-phonecat\npm-debug.log - check what headers you are trying to install - Grundy
- @Grundy how can this be done? - titov_andrei
|
2 answers
I also had a problem for a long time I tried everything. It helped me to go on the road.
angular-phonecat \ node_modules \ http-server \ node_modules \ ecstatic \ lib \ ecstatic
and in the file etag.js replace with this:
module.exports = function (stat) { return JSON.stringify([stat.ino, stat.size, stat.mtime.toJSON()].join('-')); } it helped me, they say that this is fixed in the latest version of the http-server.
|
This problem was personally related to the npm package "karma", when the non-en-en locale was used. In this case, you had to go to "node_modules / karma / lib / middleware / commonjs" and delete or comment on the 76th line
response.setHeader('Expires', (new Date(0)).toString()) Well, either correct it so that it generates a string without Latin letters.
|