jasonsanjose / brackets-sass

Enable Live Preview and compile SASS files within Brackets
MIT License
183 stars 34 forks source link

New versions not working on Linux #106

Open oraculus opened 9 years ago

oraculus commented 9 years ago

Brackets 1.2 Kubuntu 14.04

the new versions 2.x are not working on linux, the error given is "Max connection attempts reached" I just did a very simple demo file, demo.scss

$demo:1px;
.demo{width: $demo;}

with brackets-sass.1.0.0-67 compiles good into demo.css, with no errors with brackets-sass.2.x gives "Max connection attempts reached" and is not compiled

aiphee commented 9 years ago

I can confirm, version 1.0.0-67 works just fine while the new one does not.

Druggist commented 9 years ago

Same for me on Windows everything works fine but when I installed new version on Ubuntu 14.10 x64 compiler stopped working with this error

mevir commented 9 years ago

Issue confirmed on UbuntuGnome 14.10 (1.0.0-67 works fine, 2.x gives "Max connection attempts reached")

ldiaz commented 9 years ago

Same here in xubuntu 14.04 2.x gives "Max connection attempts reached"), the weird thing is that a popup window shows and error message and the tittle is associate to the brackets-git extension as described here https://github.com/zaggino/brackets-git/issues/410

But the main error is from the bracked-sass extension.

Hope a fix appear soon.

ldiaz commented 9 years ago

Hi again folks, good news I made it work. I decided to check the error and finally using some console.log messages found this error message:

Error: /home/leonardo/.config/Brackets/extensions/user/jasonsanjose.brackets-sass/node/2.0.1/node_modules/node-sass/vendor/linux-ia32-node-0.10/binding.node: wrong ELF class: ELFCLASS32
    at Module.load (module.js:356:32)

with that info was easy to notice the provided version of the binding.node was not working with my linux arch. So the solution was to build my own version, the provided one is build for 32bits, I compiled my own version for 32bits and it didn't work either, I suppose in the mac somehow works, but in linux it doesn't. So a normal build worked fine.

First I got the brackets-sass sources:

git clone git@github.com:jasonsanjose/brackets-sass.git

go to the node-sass folder:

cd brackets-sass/node/2.0.1/node_modules/node-sass/

Install required tools:

npm install
npm install -g node-gyp
sudo apt-get install g++-multilib

build the bindind.node

node-gyp rebuild
#It has to end with an OK result, if any error cause of some missing header install 
#sudo apt-get install libc6-dev-i386
#and try again

you end up having a file binding.node file in build/Release/ folder Copy this file to the extension and close/open brackets (DONT only F5)

cp build/Release/binding.node ~/.config/Brackets/extensions/user/jasonsanjose.brackets-sass/node/2.0.1/node_modules/node-sass/vendor/linux-ia32-node-0.10/binding.node
Druggist commented 9 years ago

Awesome, it's finally working. Thanks for the solution Idlaz.

nicolo-ribaudo commented 9 years ago

@ldiaz Can you write this solution in the wiki?

jasonsanjose commented 9 years ago

Yikes. Thanks @ldiaz. The right fix here is to make sure the node-sass binaries from https://github.com/sass/node-sass-binaries are up to date. In short, that usually means upgrading node-sass. I see the latest is 3.0.0.

If anyone is interested in taking on this work sooner than later, please let me know. Otherwise it may have to wait a few weeks until my time frees up.

ldiaz commented 9 years ago

@nicolo-ribaudo sure I can do it. Do you think a new page called troubleshooting it's fine to start adding this kind of things?

ldiaz commented 9 years ago

@jasonsanjose I'd like to help you with that, but I would need some sort of guide about it.

jasonsanjose commented 9 years ago

@ldiaz Just updated https://github.com/jasonsanjose/brackets-sass/blob/master/node/2.0.1/README.md.

jGleitz commented 9 years ago

[Edit: Got it working – see below]

Hi everyone,

I'm facing the same error as described in #105 – brackets sass unfortunately breaks my whole brackets by crashing node.js

I tried the fix suggested by @ldiaz, but I don't get very far, as npm install fails:

$ git clone https://github.com/jasonsanjose/brackets-sass.git
...
$ cd brackets-sass/node/2.0.3/node_modules/node-sass/
$ npm install

npm ERR! node-sass@3.2.0 install: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-sass@3.2.0 install script.
npm ERR! This is most likely a problem with the node-sass package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node scripts/install.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls node-sass
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.19.0-25-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/josh/Ablage/sasstmp/brackets-sass/node/2.0.3/node_modules/node-sass
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/josh/Ablage/sasstmp/brackets-sass/node/2.0.3/node_modules/node-sass/npm-debug.log
npm ERR! not ok code 0

$ sudo npm install -g node-gyp
npm WARN engine hawk@3.1.0: wanted: {"node":">=0.10.32"} (current: {"node":"0.10.25","npm":"1.4.21"})
/usr/local/bin/node-gyp -> /usr/local/lib/node_modules/node-gyp/bin/node-gyp.js
node-gyp@2.0.2 /usr/local/lib/node_modules/node-gyp
├── graceful-fs@3.0.8
├── semver@4.3.6
├── osenv@0.1.3 (os-tmpdir@1.0.1, os-homedir@1.0.1)
├── nopt@3.0.3 (abbrev@1.0.7)
├── minimatch@1.0.0 (sigmund@1.0.1, lru-cache@2.6.5)
├── mkdirp@0.5.1 (minimist@0.0.8)
├── fstream@1.0.7 (inherits@2.0.1)
├── path-array@1.0.0 (array-index@0.1.1)
├── tar@1.0.3 (block-stream@0.0.8, inherits@2.0.1)
├── glob@4.5.3 (inherits@2.0.1, once@1.3.2, inflight@1.0.4, minimatch@2.0.10)
├── rimraf@2.4.2 (glob@5.0.14)
├── which@1.1.1 (is-absolute@0.1.7)
├── npmlog@1.2.1 (ansi@0.3.0, are-we-there-yet@1.0.4, gauge@1.2.2)
└── request@2.60.0 (aws-sign2@0.5.0, forever-agent@0.6.1, caseless@0.11.0, stringstream@0.0.4, tunnel-agent@0.4.1, oauth-sign@0.8.0, isstream@0.1.2, json-stringify-safe@5.0.1, extend@3.0.0, node-uuid@1.4.3, qs@4.0.0, combined-stream@1.0.5, form-data@1.0.0-rc3, mime-types@2.1.4, http-signature@0.11.0, bl@1.0.0, tough-cookie@2.0.0, hawk@3.1.0, har-validator@1.8.0)

$ sudo apt-get install g++-multilib
...
$ node-gyp rebuild
$ ls -a
.  ..  bin  binding.gyp  lib  LICENSE  node_modules  package.json  README.md  scripts  src  vendor

As you can see, no build directory is created.

Does anyone have suggestions on how to proceed? Can this issue be fixed in the package itself?

System info:

Ubuntu 15.04

Brackets Release 1.4 Experimenteller Build 1.4.0-16380 (release 273804eb3)

jGleitz commented 9 years ago

I finally got the plugin working for me on Ubuntu 15.04

Here is what I did: (Even after I got @ldiaz' procedure working, it did not fix the issues for me. )

Dependencies

I had everything needed available, and I'm not sure which exact packages are needed. You'll definetly need:

You'll most likely need:

Close Brackets

You have to close Brackets, as some files cannot be written otherwise.

Make node available

Most of the code expects the terminal command node to point to node js. That is not the case on current ubuntu. I went for the most dirty way (You will most likely want something nicer!):

sudo rm /usr/sbin/node # Only needed if you have ax25-node installed
sudo ln -s /usr/bin/nodejs /usr/bin/node
source ~/.bashrc

Clone the repository, copy needed files to extension folder

I built right in the extension folder and got the needed files from the repository:

git clone https://github.com/jasonsanjose/brackets-sass.git /tmp/bracketssass
cp -R /tmp/bracketssass/node/2.0.3/node_modules/node-sass  ~/.config/Brackets/extensions/user/jasonsanjose.brackets-sass/node/2.0.3/node_modules/
cd ~/.config/Brackets/extensions/user/jasonsanjose.brackets-sass/node/2.0.3/node_modules/node-sass
sudo chown -R `whoami`:`whoami` .

Edit binding.gyp

binding.gyp references libsass_ext which raises and error – but it's not needed. Therfore we edit the file:

cp binding.gyp binding.old.gyp
vim binding.gyp #Use your editor

Now remove all blocks related to libsass_ext (in my case, lines 26 to 56) and add

'dependencies': [
  'src/libsass.gyp:libsass',
],

to the binding file. (In my case, I added these lines after line 22). My binding.gyp looked like this after the changes.

Build

Now we can finally build:

npm install
node-gyp rebuild

Go!

Now just restart Brackets and everything should work.

Ch4ni commented 9 years ago

Thanks @jGleitz. I followed your steps (mostly), but found that there were a few superflous instructions. Cloning the repository somewhere in ~ (read: anywhere in ~. I put mine in ~/Code/brackets-sass) negates the need to run chown after copying the node-sass directory. In addition, there appears to be no need to run source ~/.bashrc.

akuzia commented 7 years ago

Im kind of new to node. Tried to rebuild and get stuck:

"gyp ERR! build error gyp ERR! stack Error: "make" failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/node-gyp/lib/build.js:276:23) gyp ERR! stack at emitTwo (events.js:87:13) gyp ERR! stack at ChildProcess.emit (events.js:172:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12) gyp ERR! System Linux 4.4.0-45-generic gyp ERR! command "/usr/bin/nodejs" "/usr/local/bin/node-gyp" "rebuild" gyp ERR! cwd /home/kuzia/.config/Brackets/extensions/user/jasonsanjose.brackets-sass/node/2.0.3/node_modules/node-sass gyp ERR! node -v v4.2.6 gyp ERR! node-gyp -v v3.4.0 gyp ERR! not ok "

gverm commented 7 years ago

@trahibidadido Sorry for the late response, is this still an issue? I'll be testing Linux compatibility tomorrow. I know it is broken, but I will do my best to try and fix it ASAP and roll out another update.

akuzia commented 7 years ago

@Brainzyy I've switched to Atom since that moment, if I'll have some spare time I will test dev branch, if it will be available

gverm commented 7 years ago

@trahibidadido You don't have to do anything with Github, I pushed an update to the Brackets Extension Repo. So just update/install the plugin from inside Brackets.

akuzia commented 7 years ago

@Brainzyy maybe I've forgot how to use it, but I get no errors, same s no finl css compilation. node v 4.2.6

akuzia commented 7 years ago

I've double checked my pref. Everything should be ok, but... ` "sass.compass": false,

"sass.compiler": "libsass",

"sass.enabled": true,

"sass.options": {

    "_eventHandlers": {

        "change": []

    },

    "type": "object"

},

"sass.timeout": -1,`
gverm commented 7 years ago

@trahibidadido I have no clue about that... I tested on Ubuntu, just installed brackets and installed the plugin. Installing a custom node version could pollute everything. because I updated the version of node shipped with the plugin to a version that works with most Linux distros.