Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError when running single task #5

Closed
nicky-lenaers opened this issue Mar 7, 2015 · 8 comments · Fixed by #6
Closed

TypeError when running single task #5

nicky-lenaers opened this issue Mar 7, 2015 · 8 comments · Fixed by #6
Labels

Comments

@nicky-lenaers
Copy link

I have a very simple gulp task setup to run like so:

gulp.task('shrinkwrap', function() {
    return gulp.src('package.json')
        .pipe(shrinkwrap())
        .pipe(gulp.dest('./'))
        .pipe(gutil.log(gutil.colors.green('Build Successful!')));
});

But when I run it, it keeps running into the same error. I'm assuming it's a bug, because I searched the internet for solutions, none found. Since this is the only plugin affected, I figured it's most likely a bug. However, it does write the actual npm-shrinkwrap.json file.

Bug in ternminal:
gulp-shrinkwrap-bug

You can ignore the 'Connected to MEAN Developer Database' in between.

@chmontgomery
Copy link
Owner

If you figure out a solution I would accept a pull request.

@nicky-lenaers
Copy link
Author

I'm not too familiar with writing the actual plugins, but I'll keep an eye out!

chmontgomery added a commit that referenced this issue Mar 13, 2015
Adds support for passing shrinkwrap options. Fixes #4
Bump to latest npm cli. Fixes #5

gulp integration tests and some minor bug fixes
@chmontgomery
Copy link
Owner

@NickyL can you try v2.0.0 and see if that fixes your problem? Thanks!

@nicky-lenaers
Copy link
Author

I'll give it a go tomorrow. I'll let you know!

@nicky-lenaers
Copy link
Author

@chmontgomery I still get the exact same error after updating to v2.0.1. Any ideas?

@chmontgomery
Copy link
Owner

can you paste in the contents of your package.json? And also the version of gulp you're using?

@nicky-lenaers
Copy link
Author

gulp v 3.8.11 (both global and local)

My relevant package.json:

"devDependencies": {
    "dedupe": "1.0.0",
    "gulp": "3.8.11",
    "gulp-angular-htmlify": "2.1.1",
    "gulp-autoprefixer": "2.0.0",
    "gulp-concat": "2.4.2",
    "gulp-if": "1.2.5",
    "gulp-imagemin": "^2.2.1",
    "gulp-jshint": "1.9.0",
    "gulp-livereload": "3.0.2",
    "gulp-minify-css": "0.5.1",
    "gulp-minify-html": "0.1.8",
    "gulp-plumber": "0.6.6",
    "gulp-processhtml": "1.0.2",
    "gulp-rename": "^1.2.0",
    "gulp-sass": "1.3.3",
    "gulp-shrinkwrap": "^2.0.1",
    "gulp-sourcemaps": "1.5.0",
    "gulp-typescript": "2.4.2",
    "gulp-uglify": "1.0.2",
    "gulp-util": "3.0.1",
    "merge2": "^0.3.1",
    "morgan": "1.5.1",
    "node-sass": "2.0.1",
    "yargs": "1.3.3"
  },
  "dependencies": {
    "body-parser": "1.10.0",
    "express": "4.10.6",
    "mongoose": "3.8.23"
  }

@chmontgomery
Copy link
Owner

@NickyL Using your package.json and gulp task I'm seeing a different error message than you but I think it may be related:

[22:13:22] Using gulpfile ~/Projects/test/1/gulpfile.js
[22:13:22] Starting 'shrinkwrap'...
[22:13:22] Build Successful!
[22:13:22] 'shrinkwrap' errored after 5.65 ms
[22:13:22] TypeError: Object #<Object> has no method 'on'
    at DestroyableTransform.Stream.pipe (stream.js:65:8)
    at Gulp.<anonymous> (/Users/montgomeryc/Projects/test/1/gulpfile.js:9:7)
    at module.exports (/Users/montgomeryc/Projects/test/1/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:34:7)
    at Gulp.Orchestrator._runTask (/Users/montgomeryc/Projects/test/1/node_modules/gulp/node_modules/orchestrator/index.js:273:3)
    at Gulp.Orchestrator._runStep (/Users/montgomeryc/Projects/test/1/node_modules/gulp/node_modules/orchestrator/index.js:214:10)
    at Gulp.Orchestrator.start (/Users/montgomeryc/Projects/test/1/node_modules/gulp/node_modules/orchestrator/index.js:134:8)
    at /Users/montgomeryc/.nvm/v0.10.33/lib/node_modules/gulp/bin/gulp.js:129:20
    at process._tickCallback (node.js:419:13)
    at Function.Module.runMain (module.js:499:11)
    at startup (node.js:119:16)
    at node.js:906:3

The problem has to do with your gulpfile.js. gutil.log is not meant to be called as part of a stream. Either remove the pipe to gutil or use a package like through2 and put the call to gutil inside there. If you're still seeing an error message, make sure to start fresh by doing the following (assuming you're in a linux/unix env):

rm -r node_modules
npm cache clean
npm install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants