로컬 개발을 위해 grunt-express를 사용하고 있습니다. 여기 grunt-express에 --harmony node 플래그를 추가하는 방법
는을 시작 내가
툴툴 거리는 소리와 함께 내 로컬 서버를 시작 내 GruntFile.js
var path = require('path'); module.exports = function(grunt){ grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), uglify:{ options:{ banner:'/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n' } }, express:{ server:{ options:{ debug:true, server: path.resolve('app.js') } } }, env : { options:{ }, dev : { NODE_ENV : 'development' }, prod : { NODE_ENV : 'production' } }, mochaTest:{ test:{ options:{ reporter:'spec' }, src:['tests/*.js'] } } }); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-express'); grunt.loadNpmTasks('grunt-env'); grunt.loadNpmTasks('grunt-mocha-test'); grunt.loadNpmTasks('grunt-shell'); // tasks grunt.registerTask('start', ['env:dev', 'express', 'express-keepalive']); grunt.registerTask('stop', ['express-stop']); grunt.registerTask('test', 'mochaTest'); };
하지만 나는 실행 노드에 --harmony 플래그를 추가 할 필요가 .
어떻게하면됩니까?
에 의해 거짓로 설정됩니다. – ulisesrmzroche
실제 차이점은 없습니다. 'grunt '를 입력하면'/ usr/local/bin/node/usr/local/bin/grunt' (환경마다 경로가 다름)가 효과적으로 수행됩니다. 그래서/usr/local/bin/node --harmony/usr/local/bin/grunt start를 할 수 있지만 경로는 기계마다 다를 수 있습니다. npm을 사용하여 경로 차이를 해결하는 것이 더 나은 전략입니다. –
명령을 호출하는 방식과 아키텍처에 영향을주는 방식에 차이가 있습니다. 하나는 '쓰레기'라고 입력하고 다른 하나는'npm start'라고 입력하십시오. 이런 식으로 사용할 때 둘 다 작업 주자가되어야합니다. 실제로 이렇게 할 수 있습니다. http://gruntjs.com/frequently-asked-questions#options – ulisesrmzroche