0

I'm trying to install LESS css in Netbeans, but I'm running into one problem after another. As such, I already have LESS installed, but I can't get it running.

Less is installed via the npm package, I installed it using the packaging system, less itself via Terminal. The first problem I had was that despite a successful installation, Netbeans didn't get to the files he needed (usr/local/), I could either change permissions there, which I don't want to dig into, or change the location. So I changed the location of the .npm and .npm-global folders to my root (home/ivet/), from where Netbeans managed to load it.

So I set everything there, the general settings and the specific project and it looked fine. I want it to be converted to css automatically after saving, but it throws the message "/usr/bin/env:"node": Directory or file does not exist" and the target css file is still empty.

I found a few advices, basically the same: "ln -s /usr/bin/node/ usr/local/bin/nodejs", but it tells me that the link already exists and nothing will solve it. On closer inspection, I found that the link does exist, but the target file does not exist.

I've also found that installing Nodejs legacy solves this, but this is an older piece of advice, the package no longer exists, and terminal pretends to have the packages that replace this installed. Even when searching for via grep, I couldn't find the file it should link to (neither node nor nodejs).

There are the same tips everywhere that don't work for me and I don't know what to try next. I use Linux Mint 20, but I call myself a Linux BFU, so please write answer step by step :-D

Thanks for the advice

2 Answers2

0

Try completely removing NodeJS & npm and try to install NodeJS using nvm i.e., node version manager.

You can follow this link on how to install nodejs and npm using nvm.

It's always a tedious task sometimes when it comes to package managment with npm, so it's better to go with nvm and I strongly suggest to always have a fallback option for node version when using with or without nvm i.e.,

NodeJS LTS version & NodeJS latest/stable version.

There's also an alternative solution i.e.,you can try switching to yarn package manager.

  • Thanks, but I'm afraid it doesn't help. Still the same problem - message "/usr/bin/env:"node": Directory or file does not exist" and the target css file is still empty. From instalation I need the file lessc and it has a first two lines "#!/usr/bin/env node "use strict";" I suppose I should make a link? – Ivet Lev Mar 31 '21 at 19:44
  • You can checkout this [post](https://stackoverflow.com/questions/26320901/cannot-install-nodejs-usr-bin-env-node-no-such-file-or-directory). I hope that gives you any idea about your issue. I guess you've messed up node:env symbolic links. You can try the solution as you've said i.e., by making a link to `/usr/bin/env`. – iCantFindaGoodUsername Apr 01 '21 at 05:58
0

I've had this issue on Ubuntu and I've resolved it likes this:

First of all I've removed node and npm packages via

sudo aptitude remove node npm

Then I've added the official repositories

curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash -

After which I've just updated the list of packages with sudo aptitude update and then installed Node

sudo aptitude install nodejs npm

And that was it. With these steps done, everything just started to work.

danaketh
  • 148
  • 1
  • 6