3
ちょっと前にgulpを使い始めたばかりですが、このエラーが発生したときにすべてがうまくいきます。この構文エラーポイントを行いBrowserifyタスクエラー
events.js:141
throw er; // Unhandled 'error' event
^
SyntaxError: Unterminated string constant
browserifyがぶ飲みを実行しているとき、私は
//gulpfile.js
var gulp = require('gulp'),
browserify = require('browserify'),
source = require('vinyl-source-stream');
// Browserify task
gulp.task('browserify', function() {
return browserify(['app/scripts/app.js'], {debug:true})
.bundle()
.pipe(source('bundle.js'))
.pipe(gulp.dest('dist/scripts'))
});
エラー
を試してみましたか? package.jsonファイルのエラーについての記事も読んでいます。"devDependencies": {
"browserify": "^13.0.0",
"gulp": "^3.9.1",
"gulp-autoprefixer": "^3.1.0",
"gulp-clean-css": "^2.0.4",
"gulp-connect": "^3.2.1",
"gulp-imagemin": "^2.4.0",
"gulp-less": "^3.0.5",
"gulp-plumber": "^1.1.0",
"gulp-uglify": "^1.5.3",
"vinyl-source-stream": "^1.1.0"
},
"dependencies": {
"angular": "^1.5.3",
"imagemin-pngquant": "^4.2.2"
}
//browserify package.json
{
"name": "browserify",
"version": "13.0.0",
"description": "browser-side require() the node way",
"main": "index.js",
"bin": {
"browserify": "bin/cmd.js"
},
"repository": {
"type": "git",
"url": "git+ssh://[email protected]/substack/node-browserify.git"
},
"keywords": [
"browser",
"require",
"commonjs",
"commonj-esque",
"bundle",
"npm",
"javascript"
],
"dependencies": {
"JSONStream": "^1.0.3",
"assert": "~1.3.0",
"browser-pack": "^6.0.1",
"browser-resolve": "^1.11.0",
"browserify-zlib": "~0.1.2",
"buffer": "^4.1.0",
"concat-stream": "~1.5.1",
"console-browserify": "^1.1.0",
"constants-browserify": "~1.0.0",
"crypto-browserify": "^3.0.0",
"defined": "^1.0.0",
"deps-sort": "^2.0.0",
"domain-browser": "~1.1.0",
"duplexer2": "~0.1.2",
"events": "~1.1.0",
"glob": "^5.0.15",
"has": "^1.0.0",
"htmlescape": "^1.1.0",
"stream-http": "^2.0.0",
"https-browserify": "~0.0.0",
"inherits": "~2.0.1",
"insert-module-globals": "^7.0.0",
"isarray": "0.0.1",
"labeled-stream-splicer": "^2.0.0",
"module-deps": "^4.0.2",
"os-browserify": "~0.1.1",
"parents": "^1.0.1",
"path-browserify": "~0.0.0",
"process": "~0.11.0",
"punycode": "^1.3.2",
"querystring-es3": "~0.2.0",
"read-only-stream": "^2.0.0",
"readable-stream": "^2.0.2",
"resolve": "^1.1.4",
"shasum": "^1.0.0",
"shell-quote": "^1.4.3",
"stream-browserify": "^2.0.0",
"string_decoder": "~0.10.0",
"subarg": "^1.0.0",
"syntax-error": "^1.1.1",
"through2": "^2.0.0",
"timers-browserify": "^1.0.1",
"tty-browserify": "~0.0.0",
"url": "~0.11.0",
"util": "~0.10.1",
"vm-browserify": "~0.0.1",
"xtend": "^4.0.0"
},
"devDependencies": {
"backbone": "~0.9.2",
"browser-unpack": "^1.1.1",
"coffee-script": "~1.10.0",
"coffeeify": "~1.1.0",
"es6ify": "~0.4.8",
"isstream": "^0.1.2",
"seq": "0.3.5",
"tap": "^2.2.0",
"temp": "^0.8.1",
"through": "^2.3.4"
},
"author": {
"name": "James Halliday",
"email": "[email protected]",
"url": "http://substack.net"
},
"scripts": {
"test": "tap test/*.js"
},
"license": "MIT",
"gitHead": "5b82a2f1bc061cb47ff4aa7c702ed79fc20effa8",
"bugs": {
"url": "https://github.com/substack/node-browserify/issues"
},
"homepage": "https://github.com/substack/node-browserify#readme",
"_id": "[email protected]",
"_shasum": "8f223bb24ff4ee4335e6bea9671de294e43ba6a3",
"_from": "[email protected]",
"_npmVersion": "2.14.7",
"_nodeVersion": "4.2.3",
"_npmUser": {
"name": "feross",
"email": "[email protected]"
},
"dist": {
"shasum": "8f223bb24ff4ee4335e6bea9671de294e43ba6a3",
"tarball": "http://registry.npmjs.org/browserify/-/browserify- 13.0.0.tgz"
},
"maintainers": [
{
"name": "domenic",
"email": "[email protected]"
},
{
"name": "dominictarr",
"email": "[email protected]"
},
{
"name": "feross",
"email": "[email protected]"
},
{
"name": "jmm",
"email": "[email protected]"
},
{
"name": "mafintosh",
"email": "[email protected]"
},
{
"name": "maxogden",
"email": "[email protected]"
},
{
"name": "mellowmelon",
"email": "[email protected]"
},
{
"name": "substack",
"email": "[email protected]"
},
{
"name": "terinjokes",
"email": "[email protected]"
},
{
"name": "thlorenz",
"email": "[email protected]"
},
{
"name": "zertosh",
"email": "[email protected]"
}
],
"directories": {},
"_resolved": "https://registry.npmjs.org/browserify/-/browserify-13.0.0.tgz",
"readme": "ERROR: No README data found!"
}
を追加することによって、エラーなしでこれを実行するために管理します。 –
@αƞjiβi juzは、パッケージファイルが最初のファイルとはかなり異なる数の依存関係を作成することを認識しています。 browserifyのクリーンな再インストールを行う方法はありますか? – mark5