我是firebase和nodemailer的新手,我写了一个代码,将反馈/意见直接发送到我的Gmail帐户。不幸的是,尝试部署功能时会出现错误。
Nb:我正在使用节点v10.15.3
const mailOptions = {
to: val.email,
subject: 'Your message has been sent, Thank you',
text:`Your message content here\n
Subject:${val.name}\n
Sender's Name: ${val.name} \n
Content: ${val.message}.\n
This tour will take place from
${val.arrivalDate} to ${val.departureDate}\n
`
}
return mailTransport.sendMail(mailOptions).then((snapshot) =>{
console.log('Mail sent:', snapshot);
return 1;
}).catch( error => {
console.error('Error:', error);
return 1;
});
});
这是CLI发出的消息
i deploying functions
Running command: npm --prefix functions run build
> functions@ build J:\godsonsite\laitayo\functions
> tslint -p tslint.json && ./node_modules/.bin/tsc
'.' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! functions@ build: `tslint -p tslint.json && ./node_modules/.bin/tsc`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the functions@ build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Nadeem\AppData\Roaming\npm-cache\_logs\2019-05-29T08_26_21_573Z-debug.log
events.js:174
throw er; // Unhandled 'error' event
^
Error: spawn npm --prefix functions run build ENOENT
at notFoundError (C:\Users\Nadeem\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\cross-env\node_modules\cross-spawn\lib\enoent.js:6:26)
at verifyENOENT (C:\Users\Nadeem\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\cross-env\node_modules\cross-spawn\lib\enoent.js:40:16)
at ChildProcess.cp.emit (C:\Users\Nadeem\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\cross-env\node_modules\cross-spawn\lib\enoent.js:27:25)
at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
Emitted 'error' event at:
at ChildProcess.cp.emit (C:\Users\Nadeem\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\cross-env\node_modules\cross-spawn\lib\enoent.js:30:37)
at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
Error: functions predeploy error: Command terminated with non-zero exit code1