0
gulpを実行するとTypeError: Cannot read property 'map' of undefined
エラーが発生します。私はなぜsrcフォルダに4つの.jsxファイルがあるのか分かりません。 ノードv6.11.0を実行しています。"TypeError:Gulp実行時に 'undefinedの' map 'プロパティを読み取れません
マイファイル
$ find . | grep -v node_modules
.
./.node-version
./application.js
./Gulpfile.js
./index.html
./package.json
./src
./src/app.jsx
./src/badge.jsx
./src/thumbnail-list.jsx
./src/thumbnail.jsx
Gulpfile.js
var gulp = require('gulp');
var react = require('gulp-react');
var concat = require('concat');
gulp.task('default', function() {
return gulp.src('./src')
.pipe(react())
.pipe(concat('application.js'))
.pipe(gulp.dest('./'));
});
package.json
{
"name": "thumbnail-gulp",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"browserify": "^9.0.3",
"concat": "^1.0.3",
"gulp": "^3.9.1",
"gulp-concat": "^2.6.1",
"gulp-react": "^3.1.0",
"gulp-util": "^3.0.4",
"react": "^0.13.3",
"reactify": "^1.1.0",
"vinyl-source-stream": "^1.1.0",
"watchify": "^2.4.0"
},
"devDependencies": {
"gulp": "^3.9.1"
}
}
エラー
➜ thumbnail-gulp node -v
v6.11.0
➜ thumbnail-gulp gulp
[09:49:31] Using gulpfile ~/Work/LearnReact/ReactCasts-tasks/first-app/thumbnail-gulp/gulpfile.js
[09:49:31] Starting 'default'...
[09:49:31] 'default' errored after 9.57 ms
[09:49:31] TypeError: dest.on is not a function
at DestroyableTransform.Readable.pipe (/Users/martins/Work/LearnReact/ReactCasts-tasks/first-app/thumbnail-gulp/node_modules/gulp-react/node_modules/readable-stream/lib/_stream_readable.js:556:8)
at Gulp.<anonymous> (/Users/martins/Work/LearnReact/ReactCasts-tasks/first-app/thumbnail-gulp/gulpfile.js:8:6)
at module.exports (/Users/martins/Work/LearnReact/ReactCasts-tasks/first-app/thumbnail-gulp/node_modules/orchestrator/lib/runTask.js:34:7)
at Gulp.Orchestrator._runTask (/Users/martins/Work/LearnReact/ReactCasts-tasks/first-app/thumbnail-gulp/node_modules/orchestrator/index.js:273:3)
at Gulp.Orchestrator._runStep (/Users/martins/Work/LearnReact/ReactCasts-tasks/first-app/thumbnail-gulp/node_modules/orchestrator/index.js:214:10)
at Gulp.Orchestrator.start (/Users/martins/Work/LearnReact/ReactCasts-tasks/first-app/thumbnail-gulp/node_modules/orchestrator/index.js:134:8)
at /usr/local/lib/node_modules/gulp-cli/lib/versioned/^3.7.0/index.js:51:20
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickCallback (internal/process/next_tick.js:104:9)
at Module.runMain (module.js:606:11)
/Users/martins/Work/LearnReact/ReactCasts-tasks/first-app/thumbnail-gulp/node_modules/concat/index.js:17
const fileList = files.map(f => path_1.join(folder, f));
^
TypeError: Cannot read property 'map' of undefined
at fs_1.readdir (/Users/martins/Work/LearnReact/ReactCasts-tasks/first-app/thumbnail-gulp/node_modules/concat/index.js:17:31)
at FSReqWrap.oncomplete (fs.js:123:15)
私は推測、あなたは 'dependencies'ブロックで'飲み込む-map'モジュールが欠落しています。それが機能しているかどうかを追加して確認できますか? –
ヒントをありがとう。私は 'npm i - save gulp-map'をやったが、それでも失敗する。私も完全なエラーで投稿を更新しました。他の顔をしてください。 :-) – martins