Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New versions not working on Linux #106

Open
oraculus opened this issue Mar 14, 2015 · 21 comments
Open

New versions not working on Linux #106

oraculus opened this issue Mar 14, 2015 · 21 comments

Comments

@oraculus
Copy link

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
Copy link

aiphee commented Mar 24, 2015

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

@Druggist
Copy link

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
Copy link

mevir commented Mar 30, 2015

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

@ldiaz
Copy link

ldiaz commented Apr 23, 2015

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
brackets-userland/brackets-git#410

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

Hope a fix appear soon.

@ldiaz
Copy link

ldiaz commented May 8, 2015

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

Druggist commented May 8, 2015

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

@nicolo-ribaudo
Copy link
Contributor

@ldiaz Can you write this solution in the wiki?

@jasonsanjose
Copy link
Owner

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
Copy link

ldiaz commented May 8, 2015

@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
Copy link

ldiaz commented May 8, 2015

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

@jasonsanjose
Copy link
Owner

@jGleitz
Copy link

jGleitz commented Aug 11, 2015

[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! [email protected] install: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] 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 [email protected]: 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
[email protected] /usr/local/lib/node_modules/node-gyp
├── [email protected]
├── [email protected]
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])


$ 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
Copy link

jGleitz commented Aug 19, 2015

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:

  • npm (sudo apt-get install npm)
  • node-gyp (sudo npm install -g node-gyp)
  • git (sudo apt-get install git)
  • make (sudo apt-get install build-essential)
  • Obviously, brackets-sass installed in your Brackets installation

You'll most likely need:

  • g++ (sudo apt-get install g++-multilib)
  • python (sudo apt-get install python)

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
Copy link

Ch4ni commented Sep 15, 2015

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
Copy link

akuzia commented Oct 21, 2016

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
Copy link

gverm commented Dec 25, 2016

@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
Copy link

akuzia commented Dec 27, 2016

@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
Copy link

gverm commented Dec 27, 2016

@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
Copy link

akuzia commented Dec 27, 2016

@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
Copy link

akuzia commented Dec 27, 2016

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
Copy link

gverm commented Dec 27, 2016

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests