'http-server' is not recognized as an internal or external command

房东的猫 提交于 2019-12-03 02:22:45
Liad Livnat

@BenFortune found the answer it was

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

If the accepted solution did not work for you. Try the following. This solved the issue in my system.

Make sure the locations of both npm and http-server are added in environment variable 'PATH' (Both user variable and System variable).

If it is not present,

add C:\Users\username\AppData\Roaming\npm and C:\Users\username\AppData\Roaming\npm\node_modules\http-server to environment variable 'PATH'

joedavis
npm install -g http-server

Use this command to install http-server module into your project. You can verify this in package.json

You can fix the issues by doing the following steps,

  1. Install http-server globally by npm install -g http-server
  2. Added 'PATH' in environment variable for system variable. Path will be like this C:\Users\username\AppData\Roaming\npm
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!