Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/365.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
Javascript 您传递到npm http服务器的路径是什么?_Javascript_Node.js_Httpserver - Fatal编程技术网

Javascript 您传递到npm http服务器的路径是什么?

Javascript 您传递到npm http服务器的路径是什么?,javascript,node.js,httpserver,Javascript,Node.js,Httpserver,我使用的是mac电脑,我在桌面上创建了一个名为“reg”的目录,其中包含index.html,然后尝试运行http服务器“desktop/reg/”,但没有成功。我试着在我的绝对路径中添加类似“/Users/johndoe/Desktop/reg/”`的内容,但它也不起作用。我做错了什么,它一直给我404?你只需要在你的桌面文件夹中运行httpserver。 cd~/桌面 http服务器注册 尝试先按ls列出所有目录,然后查看是否有reg

我使用的是mac电脑,我在桌面上创建了一个名为“reg”的目录,其中包含index.html,然后尝试运行
http服务器“desktop/reg/”,但没有成功。我试着在我的绝对路径中添加类似
“/Users/johndoe/Desktop/reg/”`的内容,但它也不起作用。我做错了什么,它一直给我404?

你只需要在你的桌面文件夹中运行
httpserver

cd~/桌面
http服务器注册

尝试先按ls列出所有目录,然后查看是否有reg