我有一个奇怪的问题是运行gulp任务来编译browserify + coffee,react&亭子。这是我的任务:
var browserify = require('gulp-browserify');
var coffeeReactify = require('coffee-reactify');
var debowerify = require('debowerify');
var gulp = require('gulp');
var rename = require('gulp-rename');
gulp.task('coffee', function() {
return gulp.src('./app/assets/javascripts/application.coffee', { read: false })
.pipe(browserify({
debug: true,
transform: [coffeeReactify, debowerify],
extensions: ['.coffee']
})).on('error', function(error) {
console.log('----');
console.log('Compile error');
console.log();
console.log(error.message);
}).pipe(rename('application.js'))
.pipe(gulp.dest('./public/'));
});
当我在通常的ubuntu gnome-terminal
上运行此任务时,一切顺利,文件已创建并正常工作。但在atom editor terminal咖啡中没有编译。我收到这个错误。那么,我该如何解决这个问题?
[10:38:15] Using gulpfile ~/my_project/Gulpfile.js
[10:38:15] Starting 'coffee'...
----
Compile error
ENOTDIR: not a directory, open '/usr/share/atom/resources/app.asar/package.json'
[10:38:15] Finished 'coffee' after 57 ms
其他任务,例如gulp slim
或gulp sass
效果很好。
答案 0 :(得分:0)
解决此问题的关键是从<?php
define("DB_HOST", "localhost");
define("DB_USER", "root");
define("DB_PASS", "");
define("DB_NAME", "envoy");
function db_connect() {
$db = mysqli_connect(DB_HOST, DB_USER, DB_PASS) or die("ERROR!");
mysqli_select_db($db, DB_NAME);
return $db;
}
$db = db_connect();
date_default_timezone_set("EST5EDT");
$date = date('m-d-Y,h.i.sa');
$date2 = date('m/d/Y');
$filename = $date.'.csv';
//$fp = fopen($filename,"w");
$sql2 = "SELECT sku as Sku,name as 'Brochure Name',location as Location FROM brochureinfo where modified LIKE '$date2' ORDER BY name ";
$rs2 = mysqli_query($db, $sql2);
mysqli_close($db);
$row = mysqli_fetch_assoc($rs2);
$seperator = "";
$comma = "";
foreach ($row as $name => $value){
$seperator.= $comma. ''.str_replace('','""',$name);
$comma=",";
}
$seperator .= "\n";
//echo $seperator;
mysqli_data_seek($rs2,0);
while ($row = mysqli_fetch_assoc($rs2)){
//$seperator = "";
$comma = "";
foreach ($row as $name => $value){
$value = str_replace( array( "\r" , "\n", "\r\n", "\n\r" ) ,'' , $value);
$value = str_replace('</b><br>','',$value);
$value = str_replace('<b>','',$value);
$value = str_replace('<br>','',$value);
$value = str_replace('<br />','',$value);
$seperator.= $comma. ''.str_replace('','""',$value);
$comma=",";
}
$seperator .= "\n";
//putting the heading into the csv file
//fputs($fp,$seperator);
}
header('Content-Type: text/csv');
header("Content-Disposition: attachment; filename=$date.csv");
header('Pragma: no-cache');
echo $seperator;
//fclose($fp);
迁移到gulp-browserify
包。