Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/database/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
lite server-npm start打开浏览器,但未加载index.html(显示没有internet)_Npm_Package.json_Lite Server - Fatal编程技术网

lite server-npm start打开浏览器,但未加载index.html(显示没有internet)

lite server-npm start打开浏览器,但未加载index.html(显示没有internet),npm,package.json,lite-server,Npm,Package.json,Lite Server,我在Windows10中创建了一个新文件夹,并用VisualStudio代码打开了它。在根目录下创建“index.html”后,我运行了以下命令: npm init npm install --save-dev lite-server 我在脚本下的package.json中添加了以下内容: "start": "lite-server" 之后,当我运行“npm start”时,它在我的浏览器()中打开了一个新选项卡,但我的“index.html”没有加载(相反,我看到的是“没有interne

我在Windows10中创建了一个新文件夹,并用VisualStudio代码打开了它。在根目录下创建“index.html”后,我运行了以下命令:

npm init

npm install --save-dev lite-server
我在脚本下的package.json中添加了以下内容:

"start": "lite-server"
之后,当我运行“npm start”时,它在我的浏览器()中打开了一个新选项卡,但我的“index.html”没有加载(相反,我看到的是“没有internet”)。端口3000上没有运行其他进程


请您通过运行“npm start”来帮助我加载“index.html”好吗?

首先尝试这一行而不是第二行。它的顺序与它应该遵循的顺序不同

我在MacOS也遇到过同样的情况。我这样做了,它成功了。因此,如果上述操作不起作用,请在windows 10中以管理员身份运行并重试

rm -rf node_modules/
sudo npm install

先试试这一行,而不是第二行。它的顺序与它应该遵循的顺序不同

我在MacOS也遇到过同样的情况。我这样做了,它成功了。因此,如果上述操作不起作用,请在windows 10中以管理员身份运行并重试

rm -rf node_modules/
sudo npm install