npm install成功但无法运行程序

时间:2023-01-18 00:16:20

I am trying to install the http-server, bower, grunt in my windows machine. I tried to install using npm install the install is successful but when, i try to run the command it is saying command not found. I tried closing the command prompt and execute again. Same result. The file are available in appdata folders.

我正在尝试在我的Windows机器上安装http-server,bower,grunt。我尝试使用npm install安装安装成功但是,当我尝试运行命令时,它说命令未找到。我尝试关闭命令提示符并再次执行。结果相同。该文件在appdata文件夹中可用。

C:\Users\testuser>npm install http-server
+ http-server@0.11.1
updated 1 package in 5.713s

C:\Users\testuser>http-server
'http-server' is not recognized as an internal or external command,
operable program or batch file.

I tried listing the services and the service is installed

我尝试列出服务并安装了服务

C:\Users\testuser>npm list -g --depth=0
C:\Users\testuser\AppData\Roaming\npm
+-- bower@1.8.4
+-- http-server@0.11.1
`-- json-server@0.12.1

I tried searching for similar issues, but could not find the same.

我试图寻找类似的问题,但找不到相同的问题。

1 个解决方案

#1


0  

 npm install http-server -g

This will install http-server globally so that it may be run from the command line.

这将全局安装http-server,以便可以从命令行运行它。

#1


0  

 npm install http-server -g

This will install http-server globally so that it may be run from the command line.

这将全局安装http-server,以便可以从命令行运行它。