Cannot install NodeJs: /usr/bin/env: node: No such file or directory

0 votes

I'm trying to install nodeJs into my Ubuntu 14.04 in order to use GruntJs.

I've read about Ubuntu different way of doing it, so this is what I've done in order to install it:

sudo apt-get install npm

sudo npm install -g grunt-cli

Typing grunt after that I've got the error:

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

So, I've tried:

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

sudo apt-get install -y nodejs

sudo apt-get update

And trying again, and still getting the error, I've tried:

sudo add-apt-repository ttps://launchpad.net/~chris-lea/+archive/node.js/

sudo apt-get install -y nodejs

I've got this message:

nodejs is already the newest version.
0 to upgrade, 0 to newly install, 0 to remove and 3 not to upgrade.

I did try a cleanup just in case:

sudo apt-get autoremove

But nope, the error is still there: when I type grunt I still get /usr/bin/env: node: No such file or directory

What should I do?

May 5 in Java-Script by kartik
• 27,220 points
1,288 views

1 answer to this question.

0 votes

Hii,

If you already have nodejs installed (check with which nodejs) and don't want to install another package, you can, as root:

update-alternatives --install /usr/bin/node node /usr/bin/nodejs 99

Hope this works!!
Thank You!!

answered May 5 by Niroj
• 58,620 points

Related Questions In Java-Script

0 votes
1 answer

How to find event listeners on a DOM node when debugging or from the JavaScript code?

Hii @kartik, It is possible to list all ...READ MORE

answered Jun 8 in Java-Script by Niroj
• 58,620 points
213 views
0 votes
1 answer

Error:No Access-Control-Allow-Origin header is present on the requested resource node.js

Hello @kartik, My guess is that you're serving ...READ MORE

answered Jun 8 in Java-Script by Niroj
• 58,620 points
203 views
0 votes
1 answer

How to download a file from NodeJS Server using Express?

Hello @kartik, Express has a helper for this as: app.get('/download', function(req, ...READ MORE

answered 4 days ago in Java-Script by Niroj
• 58,620 points
14 views
+1 vote
1 answer

How can we send message multiple time to a specific person or group in whatsapp using loop?

Hii @kartik,  This is simple task to send single ...READ MORE

answered Feb 28 in Java-Script by Niroj
• 58,620 points
576 views
+1 vote
1 answer

How to make anchor tag with routing using Laravel?

Hey @kartik, First you have to go to ...READ MORE

answered Mar 18 in Laravel by Niroj
• 58,620 points
2,184 views
0 votes
1 answer

What is redirection in Laravel?

Named route is used to give specific ...READ MORE

answered Mar 18 in Laravel by Niroj
• 58,620 points
241 views
0 votes
1 answer

How to install Laravel via composer?

Hello, This is simple you just need to ...READ MORE

answered Mar 23 in Laravel by Niroj
• 58,620 points
189 views
+1 vote
1 answer

What are named routes in Laravel and How can specify route names for controller actions?

Hey @kartik, Named routing is another amazing feature of ...READ MORE

answered Mar 23 in Laravel by Niroj
• 58,620 points
2,716 views
+1 vote
1 answer

How to Check synchronously if file/directory exists in Node.js?

Hello, You can use fs.existsSync(): const fs = require("fs"); // ...READ MORE

answered May 28 in Java-Script by Niroj
• 58,620 points
165 views
0 votes
1 answer

How to get the directory of the currently running file?

Hello @kartik, This should do it: import ( ...READ MORE

answered May 5 in Java-Script by Niroj
• 58,620 points
84 views