Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When I try to install less css compiler under my Ubuntu 13.10 box I get following message and lescss don't working. In what way I can fix the problem? I execute:

sudo npm install -g less

After this I get e list with OK messages:

npm http 304 https://registry.npmjs.org/cryptiles
npm http 304 https://registry.npmjs.org/ctype/0.5.2
npm http 304 https://registry.npmjs.org/combined-stream
npm http GET https://registry.npmjs.org/delayed-stream/0.0.5
npm http 304 https://registry.npmjs.org/sntp
npm http 304 https://registry.npmjs.org/boom
npm http 304 https://registry.npmjs.org/delayed-stream/0.0.5

And list finished with following:

/usr/local/bin/lessc -> /usr/local/lib/node_modules/less/bin/lessc
less@1.7.0 /usr/local/lib/node_modules/less
├── mime@1.2.11
├── mkdirp@0.3.5
├── source-map@0.1.33 (amdefine@0.1.0)
├── clean-css@2.1.8 (commander@2.1.0)
└── request@2.34.0 (json-stringify-safe@5.0.0, forever-agent@0.5.2, aws-sign2@0.5.0, qs@0.6.6, tunnel-agent@0.3.0, oauth-sign@0.3.0, node-uuid@1.4.1, tough-cookie@0.12.1, http-signature@0.10.0, hawk@1.0.0, form-data@0.1.2)

After this when I tried the following commands:

echo "@foo: 25px; #foobar{font-size: @foo};" > style.less
sudo lessc ./style.less ./style.css

I get the following error:

/usr/bin/env: node: No such file or directory

After I executed

ln -s /usr/bin/node /usr/local/bin/nodejs

and created symlinks there is no errors but lessc compiler don't working properly. I have created file to test. It content is:

 cat style.less 
@color: #4D926F;

#header {
  color: @color;
}
h2 {
  color: @color;
}`

and after trying

lessc styles.less > styles.css

There is created file - styles.css but the file is empty. I also try commands that I tryed before - see top on the post. But it not working. I would be very grateful for any advice and recommendations.

Best regards.

share|improve this question
    
"I get the following message": what message? I see no error messages in your question. Also, what does "not working" mean? What are the symptoms? –  terdon Apr 14 at 13:46
    
The question is edited. –  George Apr 14 at 14:03

2 Answers 2

up vote 2 down vote accepted
sudo ln -s /usr/bin/nodejs /usr/bin/node

Is what I did the other way seems to make a broken symlink for me.

This should prove all is working:

file $(which node)
/usr/bin/node: symbolic link to `/usr/bin/nodejs'

(note it doesn't say broken symbolic link)

Unfortunaltly I believe terdon's answer will actually stop the correct answer from working

# Don't do this:
sudo apt-get install node
file $(which node)
/usr/sbin/node: symbolic link to `ax25-node' 

apt-cache show node|grep Description-en
Description-en: Amateur Packet Radio Node program (transitional package)

(you want nodejs not Amateur Packet Radio I would think :) )

Uninstalling that node package should fix that problem

-End of useful info (unless you like ham radio)-


Edit: So the whole problem is that there was a package in Debian called 'node' already, Debian got upset at nodejs for not checking if a command named node wasn't already taken by another package (the ham radio program). So Debian effectively broke node programs because packages like less that look for a command named 'node'.

If you happen to use the ham radio package then instead of making the symlink you could change the shebang line in the lessc file to #!/usr/bin/env nodejs as terdon said in the comments below.

Note if you use other npm packages you may have to change a lot of shebang lines so only do this if you really use ham radio :)

Update: Ok so I read yorodm's link a bit more and debian has changed the Ham radio package to https://packages.debian.org/sid/ax25-node Trusty actually uses this!

So if you use ham radio just delete /usr/bin/node which is a symlink to /usr/bin/ax25-node replace it with a node symlink to /usr/bin/nodejs as at the top of this answer, you will need to do this again if you just install ham radio as it overrides.

Now if you want ham radio use 'ax25-node' as the command :D

Bottom line it's easy to use 'node' for nodejs to spite the politics.

Update for the record/archive

This post was mainly for people who had installed the official sudo apt-get install nodejs package in Ubuntu 14.04 (trusty Tahr) which removed compatibility by changing the command 'node' to 'nodejs'.

At the time the actual better solution would have been to install Chris Lea's ppa on launchpad but now he has moved that again to a different location and this is the best (no fussing with symlinks) out of the box solution by Chris Lea:

curl -sL https://deb.nodesource.com/setup | sudo bash -

(Now designed for both Debian and Ubuntu)

References: https://github.com/joyent/node/wiki/installing-node.js-via-package-manager https://nodesource.com/blog/chris-lea-joins-forces-with-nodesource

That's what joyent is linking on there website so that's what I'm using :D

share|improve this answer
    
askubuntu.com/a/104452 (less via apt) and stackoverflow.com/a/23084499 (npm/nodejs from tar) seem like alternatives (haven't tried) –  sabgenton Jun 16 at 7:35
    
+1 and thanks again for pointing out the error in mine. I think, however, that it would be better to change the shebang line in ` lessc` to #!/usr/bin/env nodejs, that way if the OP ever wants to install the ham radio node package, there won't be conflicts. –  terdon Jun 16 at 12:21
    
Unless debian people convince the node people to change the exe to nodejs for all OS's you'll be changing scripts for everything you npm install that needs it. Be nice if they did :) –  sabgenton Jun 17 at 12:44
    
Good point. In that case, I'd just ln -s /usr/bin/nodejs ~/bin/node. That way env will find it correctly and it won't be overwritten by the node package. –  terdon Jun 17 at 12:54
    
You don't have to now see my update, ax25-node is the new command for the ham radio package :D –  sabgenton Jun 18 at 3:49

According to this Debian changed the name of the node binary to nodejs (that is /usr/bin/node and /usr/bin/nodejs) To fix any issues in your code just make a symlink in /usr/local/bin

sudo ln -s /usr/bin/node /usr/local/bin/nodejs
share|improve this answer
    
I have created sumlink and this helps. There is other problem. The question is edited. –  George Apr 15 at 6:32
2  
@George if this answer helped you, it would be nice of you to upvote it and/or accept it. –  terdon Apr 15 at 12:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.