![](/img/trans.png)
[英]module.js:340 throw err cannot find module articleprovider-mongodb.js
[英]Cannot run node.js example. module.js:340 throw err cannot find module
當我在命令提示符下鍵入節點example.js時,它給我一條錯誤消息。
這是我正在使用的代碼。
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(1337, 'localhost');
console.log('Server running at http://localhost:1337/');
我是直接從node.js網站上獲得的,它昨晚有效。 今天不起作用。 請提供一些幫助。
Node.js在當前目錄中查找傳遞給它的文件。
如果該文件僅存在於其他目錄中,則將無法找到它。
您需要將文件保存到正確的目錄,或者使用cd
切換到包含該文件的目錄。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.