运行 index.html 在 npm 上
run index.html on npm
我是新手所以提前道歉。
我已经在终端中使用这些脚本安装了 npm
1.curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
2.nvm install node
然后我将它设置为 运行 像这样
http-server -a localhost
Starting up http-server, serving ./public
Available on:
http://localhost:8081
我有一个索引。 html 在我要显示的文档中。我试图在浏览器中声明整个路径,例如 http://localhost:8081/Documents/testServer/index.html
但这不起作用
您必须在包含 index.html 文件的文件夹中安装工具,如下所示
首先:打开包含index.html
的文件夹
第二:安装工具
1.curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
2.nvm 安装节点
第三:开启直播服务器:
http://localhost:8081/Documents/testServer/index.html
我是新手所以提前道歉。
我已经在终端中使用这些脚本安装了 npm
1.curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
2.nvm install node
然后我将它设置为 运行 像这样
http-server -a localhost
Starting up http-server, serving ./public
Available on:
http://localhost:8081
我有一个索引。 html 在我要显示的文档中。我试图在浏览器中声明整个路径,例如 http://localhost:8081/Documents/testServer/index.html
但这不起作用
您必须在包含 index.html 文件的文件夹中安装工具,如下所示
首先:打开包含index.html
的文件夹第二:安装工具
1.curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
2.nvm 安装节点
第三:开启直播服务器:
http://localhost:8081/Documents/testServer/index.html