Saturday, April 27, 2024
 Popular · Latest · Hot · Upcoming
7
rated 0 times [  7] [ 0]  / answers: 1 / hits: 9075  / 2 Years ago, wed, september 14, 2022, 6:01:15

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
[email protected] /usr/local/lib/node_modules/less
├── [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])


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.


More From » nodejs

 Answers
1
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


[#26036] Thursday, September 15, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
cupwire

Total Points: 365
Total Questions: 126
Total Answers: 125

Location: Malaysia
Member since Thu, Feb 16, 2023
1 Year ago
;