Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/427.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
在“中找不到serevr.js”;用于Web开发的Pro Javascript“;书_Javascript_Node.js - Fatal编程技术网

在“中找不到serevr.js”;用于Web开发的Pro Javascript“;书

在“中找不到serevr.js”;用于Web开发的Pro Javascript“;书,javascript,node.js,Javascript,Node.js,有人能帮我找到并运行Adam Freeman所著的“ProJavaScript for Web Dev”一书的“下载”文件中的server.js文件吗?第8页解释如下: 我依赖于一些第三方模块,因此在安装后运行以下命令 您已经安装了 Node.js包: npm install node-static jqtpl 此命令下载并安装节点静态和jqtpl包 我在示例中用于交付静态和模板化内容的。 该命令将生成与此类似的输出(但您可能会看到一些 其他警告(可忽略): 但是,我没有收到这些消息,我的示例

有人能帮我找到并运行Adam Freeman所著的“ProJavaScript for Web Dev”一书的“下载”文件中的server.js文件吗?第8页解释如下:

我依赖于一些第三方模块,因此在安装后运行以下命令 您已经安装了

Node.js包:

npm install node-static jqtpl
此命令下载并安装节点静态和jqtpl包 我在示例中用于交付静态和模板化内容的。 该命令将生成与此类似的输出(但您可能会看到一些 其他警告(可忽略):

但是,我没有收到这些消息,我的示例也没有正确的内容。相反,我得到的是:

npm ERR! Linux 3.16.0-70-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "node-static" "jqptl"
npm ERR! node v4.4.3
npm ERR! npm  v2.15.1
npm ERR! code E404

npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/jqptl
npm ERR! 404 
npm ERR! 404 'jqptl' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/nesa/www/pro-javascript/npm-debug.log
有人能帮我吗?下载文件的链接为:



正确地键入jqtpl,而是键入jqptl。检查错误日志,查看是否正确键入了jqtpl,而不是键入了jqptl。检查您的错误日志,查看您收到了哪些消息?
node\u modules
目录是否已创建?它是这样的:
npm ERR!Linux 3.16.0-70-通用npm错误!argv“/usr/bin/nodejs”“/usr/bin/npm”“安装”“节点静态”“jqptl”npm ERR!节点v4.4.3 npm错误!npm v2.15.1 npm错误!代码E404 npm错误!404注册表返回404以便登录https://registry.npmjs.org/jqptl npm错误!404 npm错误!404“jqptl”不在npm注册表中。npm错误!404你应该让作者发布它(或者自己使用这个名字!)npm ERR!404 npm错误!404请注意,您也可以从npm ERR安装!404 tarball、文件夹、http url或git url。
使用此信息更新您的问题,而不是注释部分。@deceze我现在刚刚更新了问题。我无法重现问题。它的安装对我来说没有任何问题。你收到了什么消息?
node\u modules
目录是否已创建?它是这样的:
npm ERR!Linux 3.16.0-70-通用npm错误!argv“/usr/bin/nodejs”“/usr/bin/npm”“安装”“节点静态”“jqptl”npm ERR!节点v4.4.3 npm错误!npm v2.15.1 npm错误!代码E404 npm错误!404注册表返回404以便登录https://registry.npmjs.org/jqptl npm错误!404 npm错误!404“jqptl”不在npm注册表中。npm错误!404你应该让作者发布它(或者自己使用这个名字!)npm ERR!404 npm错误!404请注意,您也可以从npm ERR安装!404 tarball、文件夹、http url或git url。
使用此信息更新您的问题,而不是注释部分。@deceze我现在刚刚更新了问题。我无法重现问题。它的安装对我来说没有任何问题。sudo npm安装-g npm然后再试一次为什么要使用
sudo
帮助?没有提到写入任何文件时的权限问题。所使用的命令没有使用
-g
标志,因此它不会尝试全局安装。“请执行sudo npm安装-g npm,然后再试一次”-不要,为本地项目全局安装模块是一个糟糕的主意。@Quentin:谢谢,从现在起我会记住这一点。我只是尽我所能让示例运行,但是我的server.js不在那里…所以我不能…执行sudo npm安装-g npm然后再试一次为什么使用
sudo
会有帮助?没有提到写入任何文件时的权限问题。所使用的命令没有使用
-g
标志,因此它不会尝试全局安装。“请执行sudo npm安装-g npm,然后再试一次”-不要,为本地项目全局安装模块是一个糟糕的主意。@Quentin:谢谢,从现在起我会记住这一点。我只是尽我所能让示例运行,但是我的server.js不在那里…所以我不能。。。
npm ERR! Linux 3.16.0-70-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "node-static" "jqptl"
npm ERR! node v4.4.3
npm ERR! npm  v2.15.1
npm ERR! code E404

npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/jqptl
npm ERR! 404 
npm ERR! 404 'jqptl' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/nesa/www/pro-javascript/npm-debug.log