Node.js 节点文件编译错误显示?
每次运行代码节点mail2.js * 我已经安装了所有模块,但仍然出现此错误Node.js 节点文件编译错误显示?,node.js,sails.js,Node.js,Sails.js,每次运行代码节点mail2.js * 我已经安装了所有模块,但仍然出现此错误 throw err; ^ Error: Cannot find module '/Users/anuppanwar/Downloads/project/wetty/mail2.js' at Function.Module._resolveFilename (module.js:336:15) at Function.Module._load (module.js:278:25) at Function.
throw err;
^
Error: Cannot find module '/Users/anuppanwar/Downloads/project/wetty/mail2.js'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3
这是我的密码
var ses = require('node-ses')
, client = ses.createClient({ key: 'my_key', secret: 'my_secreat_key', amazone: 'https://ec3-52-11-150-17.us-west-2.compute.amazonaws.com' });
// Give SES the details and let it construct the message for you.
client.sendEmail({
to: 'anup.panwar36@gmail.com'
, from: 'anup.panwar36@gmail.com'
, cc: 'theWickedWitch@nerds.net'
, bcc: ['canAlsoBe@nArray.com', 'forrealz@.org']
, subject: 'greetings'
, message: 'your goes here'
, altText: 'plain text'
}, function (err, data, res) {
// ... i
if(err) {
throw err
}
if(data){
console.log("data"+data);
}
});
每次我运行我的代码时都会出现相同的抛出错误,不知道为什么?您没有导入
mail2
。你必须导入它
var mail2=require('mail2')代码>您尚未导入mail2
。你必须导入它
var mail2=require('mail2')代码>您如何要求mail2.js?因为在你发布的代码中,我在任何地方都看不到它。感谢并为这个错误感到抱歉。可能重复的mail2.js是如何要求的?因为在你发布的代码中,我在任何地方都看不到它。谢谢,很抱歉,这个错误。可能是重复的