在使用npm安装http-server服务时有时会遇到安装失败 这是因为缺少相关文件夹的写入权限。 这时我们只需要写下面的命令在输入电脑密码就可以了 sudo npm install http-server -g