question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

is gulpfile.coffee supported out of the box with gulp >= 3.7.0?

See original GitHub issue

After reading #103, #123, and #452, I got impression that gulpfile.coffee is supported out of the box with gulp >= 3.7.0. Is that true?

For me, it fails on win8.0 x64 with node 0.10.32 and local+global gulp 3.8.8.

Steps to reproduce:

  1. mkdir test && cd test
  2. echo require 'gulp' > gulpfile.coffee on windows, or echo "require 'gulp'" > gulpfile.coffee on linux/mac
  3. npm install -g gulp
  4. npm install gulp coffee-script
  5. gulp

Expected result is gulp complaining about missing default task. Actual result:

D:\test\gulpfile.coffee:1
tion (exports, require, module, __filename, __dirname) { gulp = require 'gulp'
                                                                        ^^^^^^
SyntaxError: Unexpected string
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Liftoff.handleArguments (C:\Users\x\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js:108:3)
    at Liftoff.launch (C:\Users\x\AppData\Roaming\npm\node_modules\gulp\node_modules\liftoff\index.js:143:6)
    at Object.<anonymous> (C:\Users\x\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js:59:5)
    at Module._compile (module.js:456:26)

Both the old workarounds do work:

  1. either gulp --require coffee-script/register
  2. or echo require('coffee-script/register'); require('./gulpfile.coffee'); > gulpfile.js before gulp

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
tkellencommented, Feb 26, 2016

This is expected. Gulp does not require coffee-script to function properly. If we bundle coffee-script we have to release a new version of Gulp when coffee-script changes. Installing locally is the best/recommended practice.

0reactions
brunocoelhocommented, Feb 26, 2016

I had this problem today using gulp@3.9.1 and I had to install coffee-script locally in order to make it work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

gulp | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
Quick Start | gulp.js
Quick Start# · Check for node, npm, and npx# · Install the gulp command line utility# · Create a project directory and navigate...
Read more >
10 things to know about Gulp - Adam Lynch
Gulp supports CoffeeScript since version 3.7. Once you npm install --save-dev coffee-script in the same directory as your gulpfile, you can have ...
Read more >
Homestead gulp/npm not working - Laracasts
<anonymous> (/home/vagrant/_test_test_/laravel/gulpfile.js:1:76) at Module. ... been reintegrated into npm and is now out of date with respect to npm npm ...
Read more >
How to fix "ReferenceError: primordials is not defined" in Node.js
Gulp 3.* doesn't work on Node.js 12.* or above. You have to downgrade Node.js, or upgrade Gulp.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found