小编swa*_*ram的帖子

GulpUglifyError:无法缩小JavaScript

我正在尝试缩小我的脚本文件,我正在使用gulp任务运行器而我正在尝试gulp-uglify插件

码:

 gulp.task('concat', function() {
    return gulp.src('app/**/*.js')
        // .pipe(concat('script.js'))
        .pipe(uglify())
        .pipe(gulp.dest('./dist/'))
});
Run Code Online (Sandbox Code Playgroud)

但我得到的错误是

在此输入图像描述

当我尝试运行gulp任务作为gulp concat任何帮助将不胜感激

javascript gulp gulp-uglify

45
推荐指数
5
解决办法
4万
查看次数

无法使用 nodemailer 发送 html 文本

我无法使用 nodemailer 在邮件中发送 html 文本。

exports.send = function(req, res) {
console.log(req.query);
var mailOptions = {
    to: req.query.email,
    subject: req.query.sub,
    text: 'Date of Interview: ' + req.query.dateOfInterview+ 'Time of Interview: ' + req.query.timeOfInterview + '' + req.query.assignedTechnicalPerson + '' + req.query.typeOfInterview + '' + req.query.interviewLocation
}
smtpTransport.sendMail(mailOptions, function(error, response) {
    if (error) {
        console.log(error);
        res.end("error");
    } else {
        console.log("Message sent: " + response.message);
        res.end("sent");

    }
});
Run Code Online (Sandbox Code Playgroud)

};

我收到的邮件是没有任何行空间的连续文本 如何使用其中的 html 标签发送相同的文本 我也尝试保留 html 并最终收到很多错误

请告诉我正确的语法

任何帮助表示赞赏

javascript node.js express nodemailer

5
推荐指数
1
解决办法
5282
查看次数

无法更新mongodb中的数据

我需要更新一些我正在使用 mongoose 驱动程序和 express js 的字段

架构:

 var mongoose = require('mongoose'),
    Schema = mongoose.Schema;

var ProfilesSchema = new Schema({

    presentRound: {
        type: Number,
        default: 1
    },

    scheduleInterviewStatus: {
        type: Boolean,
        default: false
    },

    interviewStatus: String,

    ratings: [{
        round: Number,
        rating: Number,
        feedback: String,
        interviewer: String,
        roundStatus: String
    }]
});
Run Code Online (Sandbox Code Playgroud)

module.exports = mongoose.model('Profiles', ProfilesSchema);

所以在这些我需要通过 idpresentRound scheduleInterviewStatus interviewStatusroundStatus(in ratings array by matching round number)

更新前:

    presentRound: 1,
    scheduleInterviewStatus: true,
    interviewStatus: "on-hold",
    ratings: [{
        round: 1,
        rating: 3,
        feedback: …
Run Code Online (Sandbox Code Playgroud)

mongoose mongodb node.js express mongodb-query

3
推荐指数
1
解决办法
5162
查看次数