juanfran / gulp-scss-lint

Gulp plugin to lint scss files with `scss-lint`
113 stars 33 forks source link

Generic error when the gem is not installed #75

Open navarroaxel opened 8 years ago

navarroaxel commented 8 years ago

When the scss_lint gem is not installed, the error message is Fatal undefined

I have been looking for the error and I found this:

 stream.emit('error', err);

Line 36 at lint function at src/index.js file.

Any ideas how to fix it?

Versions: gulp-scss-lint@0.4.0 gulp-util@3.0.7 node@6.6.0 ruby@2.3

juanfran commented 8 years ago

it's working for me.

The error is in command.js, error code 127.

navarroaxel commented 8 years ago

I tested it on Windows 10 and Jenkins/Red hat server. The error code is 1 in windows. In red hat I don't know.

raahede commented 7 years ago

👍

raahede commented 7 years ago

I got this to work. In the gulp-scss-lint installation guide it specifies

This plugin requires Ruby and scss-lint gem install scss_lint

I added this to my package.json, and after running npm install again it works.

"scripts": {
  "preinstall": "sudo gem install scss_lint",
},
peterkelly commented 7 years ago

I have just submitted a pull request to fix this; here's how to reproduce the problem:

$ docker run --rm -it node:8.1.2 bash
echo -e "\nHost github.com\nStrictHostKeyChecking no\n" >> /etc/ssh/ssh_config
git clone https://github.com/juanfran/gulp-scss-lint
cd gulp-scss-lint
npm install
npm test

which produces the output:

root@aca3e059ccc3:/gulp-scss-lint# npm test
npm info it worked if it ends with ok
npm info using npm@5.0.3
npm info using node@v8.1.2
npm info lifecycle gulp-scss-lint@0.4.0~pretest: gulp-scss-lint@0.4.0
npm info lifecycle gulp-scss-lint@0.4.0~test: gulp-scss-lint@0.4.0

> gulp-scss-lint@0.4.0 test /gulp-scss-lint
> mocha

  gulp-scss-lint
Fatal undefined

with the fix in place, the output shows the correct error message:

root@08553316bc9d:/gulp-scss-lint# npm test
npm info it worked if it ends with ok
npm info using npm@5.0.3
npm info using node@v8.1.2
npm info lifecycle gulp-scss-lint@0.4.0~pretest: gulp-scss-lint@0.4.0
npm info lifecycle gulp-scss-lint@0.4.0~test: gulp-scss-lint@0.4.0

> gulp-scss-lint@0.4.0 test /gulp-scss-lint
> mocha

  gulp-scss-lint
Fatal Error: Unhandled "error" event. (You need to have Ruby and scss-lint gem installed)
    at Stream.emit (events.js:185:19)
    at /gulp-scss-lint/src/index.js:36:16
    at tryCatcher (/gulp-scss-lint/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/gulp-scss-lint/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (/gulp-scss-lint/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/gulp-scss-lint/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/gulp-scss-lint/node_modules/bluebird/js/release/promise.js:689:18)
    at Async._drainQueue (/gulp-scss-lint/node_modules/bluebird/js/release/async.js:133:16)
    at Async._drainQueues (/gulp-scss-lint/node_modules/bluebird/js/release/async.js:143:10)
    at Immediate.Async.drainQueues (/gulp-scss-lint/node_modules/bluebird/js/release/async.js:17:14)
    at runCallback (timers.js:800:20)
    at tryOnImmediate (timers.js:762:5)
    at processImmediate [as _immediateCallback] (timers.js:733:5)