Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Better error messages for missing binaries #1428

Merged
merged 1 commit into from
Mar 26, 2016

Conversation

xzyfer
Copy link
Contributor

@xzyfer xzyfer commented Mar 25, 2016

This is another iteration on improving the infamous

The libsass binding was not found

Messages will now provide more useful information which will

  • give users a chance to resolve the problem themselves
  • give us more debug information from the error message alone

Error messages produced now be one of the following flavours:

Node Sass does not yet support your current environment: OS X 64-bit with Node.js 4.x
For more information on which environments are supported please see:
http://....


Error: Missing binding /tmp/node-sass/vendor/darwin-x64-47/binding.node
Node Sass could not find a binding for your current environment: OS X 64-bit with Node.js 4.x

Found bindings for the following environments:

  • OS X 64-bit with io.js 3.x
  • OS X 64-bit with Node.js 5.x

This usually happens because your environment has changed since running npm install.
Run npm rebuild node-sass to build the binding for your current environment.


Error: Missing binding /tmp/node-sass/vendor/darwin-x64-47/binding.node
Node Sass could not find a binding for your current environment: OS X 64-bit with Node.js 4.x

This usually happens because your environment has changed since running npm install.
Run npm rebuild node-sass to build the binding for your current environment.

It's worth noting that we can't really do much better than the following if users are using custom binary names or paths. I'm ok with this since those users almost never file issues.

Node Sass could not find a binding for your current environment: OS X 64-bit with Node.js 4.x

/cc @saper

@xzyfer
Copy link
Contributor Author

xzyfer commented Mar 25, 2016

We should keep the path we were looking at as well. I'll add that back in.

@xzyfer xzyfer force-pushed the feat/better-binary-error-messages branch from e7e3892 to 05bb8e4 Compare March 25, 2016 11:32
@saper
Copy link
Member

saper commented Mar 25, 2016

I like it a lot.
one thing that kept me wondering for a while: why are using a subdirectory for a platform stuff instead of xxx-yy-zzz-binding.node files?

@xzyfer
Copy link
Contributor Author

xzyfer commented Mar 25, 2016

Good question. Maybe @am11 has some background?
On 26 Mar 2016 4:28 AM, "Marcin Cieślak" notifications@github.com wrote:

I like it a lot.
one thing that kept me wondering for a while: why are using a subdirectory
for a platform stuff instead of xxx-yy-zzz-binding.node files?


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#1428 (comment)

@xzyfer xzyfer force-pushed the feat/better-binary-error-messages branch from 05bb8e4 to 5ac5bdb Compare March 26, 2016 04:02
@xzyfer
Copy link
Contributor Author

xzyfer commented Mar 26, 2016

Updated the error messages to include the expected binary path when it's missing. I'll add some tests and 🚢

@xzyfer xzyfer force-pushed the feat/better-binary-error-messages branch 2 times, most recently from b241308 to e27041d Compare March 26, 2016 05:33
@xzyfer xzyfer changed the title [WIP] Better error messages for missing binaries Better error messages for missing binaries Mar 26, 2016
@xzyfer xzyfer force-pushed the feat/better-binary-error-messages branch 2 times, most recently from ef72c2e to c41cb20 Compare March 26, 2016 06:09
This is another iteration on improving the infamous
>The `libsass` binding was not found

Messages will now provide more useful information which will
- give users a chance to resolve the problem themselves
- give us more debug information from the error message alone

Error messages produce now will look like:

>Node Sass does not yet support your current environment: OS X 64-bit with Node.js 4.x
>For more information on which environments are supported please see:
>http://....

>Node Sass could not find a binding for your current environment: OS X 64-bit with Node.js 4.x
>Found bindings for the following environments:
>  - OS X 64-bit with io.js 3.x
>  - OS X 64-bit with Node.js 5.x
>This usually happens because your environment has changed since running `npm install`.
>Run `npm rebuild node-sass` to build the binding for your current environment.

>Node Sass could not find a binding for your current environment: OS X 64-bit with Node.js 4.x
>This usually happens because your environment has changed since running `npm install`.
>Run `npm rebuild node-sass` to build the binding for your current environment.
@xzyfer xzyfer force-pushed the feat/better-binary-error-messages branch from c41cb20 to cf87e0b Compare March 26, 2016 06:17
@xzyfer
Copy link
Contributor Author

xzyfer commented Mar 26, 2016

@saper as suspected there is a reason for the having the directories - #712 (comment)

@xzyfer xzyfer merged commit d76923b into sass:master Mar 26, 2016
@xzyfer xzyfer deleted the feat/better-binary-error-messages branch March 26, 2016 06:33
@xzyfer xzyfer modified the milestone: next.patch Sep 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants