Getting Error /usr/bin/env: node : Permission Denied

18,441

Solution 1

  • When This Type is Problem Occurred Then Following Command in your Terminal

  • Most simple way is to install nodeJs with its package manager npm. Nodejs is in the repositories, but that one is a bit outdated, instead you could use this ppa:

     sudo apt-add-repository ppa:chris-lea/node.js
     sudo apt-get update
     sudo apt-get install nodejs
    

( https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager ) Especially if you're doing JavaScript/Web development nodejs is pretty important today.

  • At this point it's simply (as stated on http://lesscss.org)

     sudo npm install -g less
    
  • if you already installed lessc then above command run Two Times..

    sudo npm install -g less-plugin-clean-css
    

Solution 2

One possible reason you'd get the error you describe is that your distro package maintainers have reserved the name 'node' for something besides nodejs. If this is the case, the binary you want to use (npm will want to use) will be called 'nodejs'. To check this, run:

which node

If you don't get a path to a node binary back, it may be your problem is what I described above, then try:

which nodejs

If you get back a binary path, then you can then take the output, eg: /usr/bin/nodejs and run:

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

And you'll have a functioning nodejs installation.

Don't ask me why the maintainers of npm on these platforms aren't calling to nodejs. And don't ask me why a package installed by less than a tenth of a percent of linux users gets to own the name 'node' over 'nodejs' which a very large fraction - I suspect a double digit percentage - of linux users install. Some things just can't be explained.

Share:
18,441
aneesh
Author by

aneesh

Updated on June 05, 2022

Comments

  • aneesh
    aneesh almost 2 years

    I have done my ODOO v9 installation on my server(Centos). Everything has been installed successfully . Login page is also working but after login I am getting a page with following error

    /usr/bin/env : node : Permission Denied
    

    I tried to change the permission but my issue is not solved. Is anyone know what is this error?

    screen shot

  • marukobotto
    marukobotto over 8 years
    So, whenever this happens, then we have to install nodejs again?
  • Jainik Patel
    Jainik Patel over 8 years
    No if nodejs install one time and this error is solved
  • Keith VanderVeen
    Keith VanderVeen about 2 years
    This is not working for an Ubuntu box. Sorry! The repo isn't showing as compatible. I'm getting this error: The repository 'http://ppa.launchpad.net/chris-lea/node.js/ubuntu jammy Release' does not have a Release file.