问题
I want to run build command but got the error message:
TypeError: Path must be a string. Received undefined.
Do you guys have any ideas? Thanks.
gulp.task('build', function () {
browserify("./src/components/source.js")
.transform("babelify", {presets: ["es2015", "react"]})
.bundle()
.pipe(gulp.dest(path.resolve(__dirname, './src/app.js')));
});
Below is the tracestack details:
TypeError: Path must be a string. Received undefined
at assertPath (path.js:8:11)
at Object.posix.resolve (path.js:426:5)
at DestroyableTransform.saveFile [as _transform] (/Users/yzzhou/Documents/ReleasePlanner/node_modules/gulp/node_modules/vinyl-fs/lib/dest/index.js:36:26)
at DestroyableTransform.Transform._read (/Users/yzzhou/Documents/ReleasePlanner/node_modules/gulp/node_modules/vinyl-fs/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:184:10)
at DestroyableTransform.Transform._write (/Users/yzzhou/Documents/ReleasePlanner/node_modules/gulp/node_modules/vinyl-fs/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:172:12)
at doWrite (/Users/yzzhou/Documents/ReleasePlanner/node_modules/gulp/node_modules/vinyl-fs/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:237:10)
at writeOrBuffer (/Users/yzzhou/Documents/ReleasePlanner/node_modules/gulp/node_modules/vinyl-fs/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:227:5)
at DestroyableTransform.Writable.write (/Users/yzzhou/Documents/ReleasePlanner/node_modules/gulp/node_modules/vinyl-fs/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:194:11)
来源:https://stackoverflow.com/questions/37176273/gulp-typeerror-path-must-be-a-string-received-undefined