- xml - AJAX/Jquery XML 解析
- 具有多重继承的 XML 模式
- .net - 枚举序列化 Json 与 XML
- XML 简单类型、简单内容、复杂类型、复杂内容
所以这是我编写的第一个程序,但是当我在控制台中运行它时出现此错误。
module.js:540
throw err;
^
Error: Cannot find module 'C:\Users\Daniel\Desktop\app'
at Function.Module._resolveFilename (module.js:538:15)
at Function.Module._load (module.js:468:25)
at Function.Module.runMain (module.js:684:10)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3
我不知道为什么会这样,因为我是新手,但我检查了代码,没有任何问题。
const http = require('http');
const hostname = '127.0.0.1';
const port = 3000;
const server = http.createServer((req, res) => {
res.statusCode = 200;
res.setHeader('Content-type', 'text/plain');
res.end('Hello World!');
});
server.listen(port, hostname, () => {
console.log('Server started on port '+port);
});
最佳答案
您要执行的脚本似乎没有命名为“app”。
在使用 node
命令执行脚本时检查脚本的路径和名称。
关于javascript - Node |模块.js :540 throw err,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48168253/
在编程方面我是个菜鸟。我正在尝试了解 Node.js 和 MongoDB。 下面是我的代码,它将搜索数据库并按州(例如加利福尼亚州、夏威夷州、佛蒙特州等)和最高温度对其进行排序。 当我运行 app.j
我可能在这里遗漏了一些非常简单的东西: package main import ( "fmt" "strconv" "reflect" ) func main() {
我正在尝试运行 npm install bitgo命令但在终端上出现以下错误, npm ERR! code EMFILE npm ERR! syscall spawn git npm ERR! pat
我问了另一个与错误有关的问题。不确定我是否应该编辑该问题。 无论如何,对于下面的代码: app.use((err, req, res, next) => { res.status(err.stat
我正在使用 Promise,并且代码如下所示: function getStuff() { return fetchStuff().then(stuff => process(stuff)
这个问题已经有答案了: Why is `throw` invalid in an ES6 arrow function? (3 个回答) 已关闭 6 年前。 以下代码可以正常工作: pool.get
当我尝试向 redis 添加模块时,出现错误:(err) ERR 不支持的 CONFIG 参数:module-add 我已经通过以下方式安装了动态 redis :- $mkdir -p ~/repos
当我重新分片redis集群时,我遇到了一个问题。 redis集群信息和问题详情如下: obasa04:/usr/redis-4.0.2/src # redis-trib.rb info 10.239.
有什么理由在nodejs中写next(new Error(err))而不是next(err)吗? 非常感谢! 最佳答案 在没有任何上下文的情况下,我假设err已经是一个对象(通常在节点中),因此没有理
我正在尝试创建一个从 API 获取数据的全栈 Node 和 Vue 应用程序。我遇到了一个问题,我试图同时运行客户端和服务器,但代码遇到错误。如果我错误地构建了这个问题,请耐心等待,因为我对编码还很陌
我要更新 npm 最新版本,但显示此错误消息: G:\>npm i -g npm ERR! code ENOLOCAL npm ERR! Could not install from "" as it
为什么在执行 sudo npm install npm 时会出现这个奇怪的错误?我有时在尝试安装其他模块时也会得到它! 错误: > scrypt@6.0.3 preinstall /home/user
我使用 ctypes 围绕 libbgpdump 编写了一个 python 包装器,但是当 libbgpdump 调用“err()”时它会出现段错误。这是失败的 C 代码: if(count > MA
我想运行这个项目:https://github.com/adonis-china/adonis-adminify 当我运行npm install时,存在错误: > sqlite3@3.1.13 ins
我尝试在我的服务器上运行 npm install 并收到此错误。 > node-cron@2.0.3 postinstall /home/workspace/AgreementCancellation
我正在尝试在我的 Node 项目上创建一个错误处理程序,但我不明白一些事情。 对于抛出的错误,我可以从 2 种不同的方式中捕获: 进程.on() process.on('uncaughtExcepti
当我在我的“npm cache clean”中写入时,出现了这个错误“npm ERR!Windows_NT 6.3.9600 npm ERR!argv” C:\iaAC>npm cache clean
在我的 npm run 构建脚本执行后,我很难深入了解我收到的 npm 错误。终端报错如下: npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! vi
我试图在一个新的项目目录中运行 yo angular,但它在途中的某个地方给了我 ENOENT 错误。是的,我看过 this similar question ,但它的解决方案对我不起作用。 在运行
试图在 Ubuntu 18.04 x64 上运行它。它曾经在一天前正常工作,但它突然停止了。 npm i simple-youtube-api 我曾经能够安装它们但不是任何人,我得到这个: > buf
我是一名优秀的程序员,十分优秀!