gulp-scss-lint icon indicating copy to clipboard operation
gulp-scss-lint copied to clipboard

Generic error when the gem is not installed

Open navarroaxel opened this issue 7 years ago • 5 comments

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: [email protected] [email protected] [email protected] [email protected]

navarroaxel avatar Sep 22 '16 17:09 navarroaxel

it's working for me.

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

juanfran avatar Sep 23 '16 15:09 juanfran

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.

navarroaxel avatar Sep 23 '16 15:09 navarroaxel

👍

raahede avatar Nov 23 '16 07:11 raahede

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",
},

raahede avatar Nov 23 '16 07:11 raahede

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 [email protected]
npm info using [email protected]
npm info lifecycle [email protected]~pretest: [email protected]
npm info lifecycle [email protected]~test: [email protected]

> [email protected] 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 [email protected]
npm info using [email protected]
npm info lifecycle [email protected]~pretest: [email protected]
npm info lifecycle [email protected]~test: [email protected]

> [email protected] 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)

peterkelly avatar Jul 03 '17 11:07 peterkelly