我有一个问题,我正在尝试使用 nodemailer 执行发送邮件的文件,我需要从另一个 JS 文件中执行它,我尝试这样做:
const exec = require('child_process').exec;
exec('"C:/Users/NikitaSeliverstov/node_modules/.bin/send.js"');
Run Code Online (Sandbox Code Playgroud)
但邮件没有发送。我不需要发送 params 文件 send.js 只发送具有完全指定路径的文本文件。很抱歉有明显的问题,但我无法弄清楚。我也试着这样做:
const exec = require('child_process').exec;
exec('"node C:/Users/NikitaSeliverstov/node_modules/.bin/send.js"');
Run Code Online (Sandbox Code Playgroud) 我需要使用 azure 函数按计划运行 powershell 脚本,我尝试使用 node.js 执行该文件,但它不起作用,我不知道为什么。