search

Home  >  Q&A  >  body text

node.js - node全局安装了http-server后,在站点目录下命令行输入http-server后报错?

问题如上,全局安装了http-server后,命令行运行显示命令没运行,求解原因~

H:\web前端学习\AngularJS\BookStore>npm install http-server -g
D:\Program Files\nodejs\node_global\http-server -> D:\Program Files\nodejs\node_global\node_modules\http-server\bin\http-server
D:\Program Files\nodejs\node_global\hs -> D:\Program Files\nodejs\node_global\node_modules\http-server\bin\http-server
D:\Program Files\nodejs\node_global
`-- http-server@0.9.0


H:\web前端学习\AngularJS\BookStore>http-server
'http-server' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
迷茫迷茫2778 days ago574

reply all(2)I'll reply

  • 怪我咯

    怪我咯2017-04-17 14:26:24

    Try bringing the complete directory to execute http-server first

    D:\Program Files\nodejs\node_global\http-server

    If possible, it may be an environment variable problem. Add this path to path, and then you can execute http-server in any directory

    reply
    0
  • 高洛峰

    高洛峰2017-04-17 14:26:24

    It seems that the directory D:Program Filesnodejsnode_global is not in path. Check your system environment variable configuration

    reply
    0
  • Cancelreply