的“http服务器'不被识别为内部或外部的命令 [英] 'http-server' is not recognized as an internal or external command

查看:787
本文介绍了的“http服务器'不被识别为内部或外部的命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

安装角种子工程后,我做了以下步骤:

克隆的资源库:


  

git的克隆 https://github.com/angular/angular-seed.git


  
  

CD角种子


然后我跑NPM安装

在年底安装我得到:


  

    

angular-seed@0.0.0 preSTART C:\\用户\\用户\\文档\\ GitHub的\\ comilion \\角种子
    NPM安装


    
    

angular-seed@0.0.0安装后C:\\用户\\用户\\文档\\ GitHub的\\ MyProject的\\角种子
    亭子安装


    
    

angular-seed@0.0.0启动C:\\用户\\用户\\文档\\ GitHub的\\ MyProject的\\角种子
    HTTP服务器-a本地主机-p 2324


  
  
  

的http服务器'不被识别为内部或外部的命令,
  可运行的程序或批处理文件。


  
  

NPM ERR! angular-seed@0.0.0启动: HTTP服务器的本地主机-a -p 2324
  NPM ERR!退出状态1 NPM ERR! NPM ERR!在失败
  angular-seed@0.0.0启动脚本。 NPM ERR!这是最有可能是
  具有角种子包装的问题,NPM ERR!与故宫本身。
  NPM ERR!告诉笔者,这种失败在系统上:NPM ERR结果!
  HTTP服务器-a本地主机-p 2324 NPM ERR!您可以通过获得他们的信息:
  NPM ERR! NPM所有者LS角种子NPM ERR!有可能
  附加日志输出上面。 NPM ERR!系统Windows_NT 6.1.7601
  NPM ERR!命令C:\\ Program Files文件\\ \\\\的NodeJS node.exeC:\\ PROGRAM
  文件\\的NodeJS \\ node_modules \\故宫\\ BIN \\ NPM-cli.js开始故宫ERR!
  CWD C:\\用户\\用户\\文档\\ GitHub的\\ MyProject的\\角种子NPM ERR!
  节点-v v0.10.22 NPM ERR! NPM -v 1.3.14 NPM ERR! code ELIFECYCLE NPM
  呃! NPM ERR!其他记录详细信息可以发现:NPM ERR结果!
  C:\\用户\\用户\\文档\\ GitHub的\\ MyProject的\\角种子\\ NPM-的debug.log


请让我知道如果您有任何建议如何解决这个问题。


解决方案

@BenFortune找到了答案这是

HTTP的服务器需要在全球的装机 NPM安装-g HTTP服务器

After installing angular-seed project, i did the following steps:

Cloned the repository :

git clone https://github.com/angular/angular-seed.git

cd angular-seed

Then I ran npm install

at the end of the install i get:

angular-seed@0.0.0 prestart C:\Users\user\Documents\GitHub\comilion\angular-seed npm install

angular-seed@0.0.0 postinstall C:\Users\user\Documents\GitHub\myproject\angular-seed bower install

angular-seed@0.0.0 start C:\Users\user\Documents\GitHub\myproject\angular-seed http-server -a localhost -p 2324

'http-server' is not recognized as an internal or external command, operable program or batch file.

npm ERR! angular-seed@0.0.0 start: http-server -a localhost -p 2324 npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the angular-seed@0.0.0 start script. npm ERR! This is most likely a problem with the angular-seed package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR!
http-server -a localhost -p 2324 npm ERR! You can get their info via: npm ERR! npm owner ls angular-seed npm ERR! There is likely additional logging output above. npm ERR! System Windows_NT 6.1.7601 npm ERR! command "C:\Program Files\nodejs\\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "start" npm ERR! cwd C:\Users\user\Documents\GitHub\myproject\angular-seed npm ERR! node -v v0.10.22 npm ERR! npm -v 1.3.14 npm ERR! code ELIFECYCLE npm ERR! npm ERR! Additional logging details can be found in: npm ERR!
C:\Users\user\Documents\GitHub\myproject\angular-seed\npm-debug.log

please let me know if you have any suggestions how to solve this issue.

解决方案

@BenFortune found the answer it was

http-server needs to be installed globally with npm install -g http-server

这篇关于的“http服务器'不被识别为内部或外部的命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆