Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/24.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
Node.js Node-JS新手:我为什么要买404?(角形种子)_Node.js_Angularjs - Fatal编程技术网

Node.js Node-JS新手:我为什么要买404?(角形种子)

Node.js Node-JS新手:我为什么要买404?(角形种子),node.js,angularjs,Node.js,Angularjs,我第一次尝试NodeJS。 我在和中遵循helloworld指令(对于第一个稍微修改过的fork,它具有相同的helloworld指令) 在这两种情况下,我都应该运行repo using节点中包含的web-server.js文件,然后导航到http://localhost:/app/index.html 这给了我一个404错误页面(写在web-server.js文件中),就像/app/一样 但是如果我导航到http://localhost:我得到了web-server.js脚本所在的文件系统目录

我第一次尝试NodeJS。 我在和中遵循helloworld指令(对于第一个稍微修改过的fork,它具有相同的helloworld指令)

在这两种情况下,我都应该运行repo using节点中包含的web-server.js文件,然后导航到
http://localhost:/app/index.html

这给了我一个404错误页面(写在web-server.js文件中),就像/app/一样

但是如果我导航到
http://localhost:
我得到了web-server.js脚本所在的文件系统目录的目录列表,它也是用web-server.js编写的


知道为什么web-server.js找不到/app/或/app/index.html吗?

确保从根目录运行服务器

~/angular seed/

在这里,您可以执行
节点脚本/web server.js

然后你可以参观


http://localhost:/app/index.html

当我分叉并将存储库克隆到我的目录并运行
节点脚本/web server.js
并访问此链接时
http://localhost:8000/app/index.html#/view1
它适用于meHmm,该URL会给我相同的错误。仅供参考,不确定这是否相关,但是如果我在脚本中运行
node script/web server.js
或cd,并运行
node web server.js
而不是只运行
/web server.js
,则node退出时会出现一个错误,即它找不到文件
web server.js
我通过运行OSX安装程序获得的节点,它成功退出。这很奇怪,因为当我cd到
脚本
并运行
web server.js
时,我会得到404,但是当我回到根目录运行
script/web server.js
然后访问这个
localhost:8888/
然后我得到目录列表,然后我可以转到
app
find
index.html
那里没有问题。你有答案,但对我来说失败了,因为你写的是“script/”而不是“scripts/”这是文件夹的名称。请编辑您的答案。