I've installed nodejs and npm on my ubuntu. Then I installed ember on my machine and I typed ember -v to verify that ember has installed successfully. But I got the following message from the terminal:
/usr/bin/env: node: No such file or directory
I have accidently installed node (instead of nodejs) but then I removed it... now when I type node in terminal, it gives me:
The program 'node' can be found in the following packages:
* node
* nodejs-legacy
Try: apt-get install <selected package>
what I have to do to install ember properly?
Run
which nodejs
in my case it displayed /usr/bin/nodejs
Make a link
sudo ln -s /usr/bin/nodejs /usr/sbin/node
it should work afterwards
Related
I've a dedicated vps running on cent os. I installed node on that by using
yum install nodejs
It installed successfully without any error and it shows version also.
node -v
v10.16.0
But it shows an error while running this with sudo
sudo node
Command not found
And when I try to run npm with sudo it shows
sudo npm
/usr/bin/env: node: No such file or directory
I tried many solutions from here like
ln -s /usr/bin/nodejs /usr/bin/node
and many more.
I've also tried reinstalling node but still no luck.
I have followed This digital ocean tutorial for installing node . and when i tried to run command sudo apt-get install npm it gave me error that
The following packages have unmet dependencies:
npm : Depends: node-gyp (>= 0.10.9) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
I removed it completely using This Post and install nodeJs again using This NVM tutorial It ended successfully installing .I made app.js with "hello world" as response and run the command node app.js and when i hit the localhost:3000 it showed Hello world - But once i closed my terminal and run node app.js it failed saying
The program 'node' is currently not installed. You can install it by typing:
sudo apt install nodejs-legacy
while i have done that before . It only runs again if i follow all the steps of nvm installation again
please try below command to install nodejs.
sudo apt-get install -y nodejs
sudo apt-get install npm
sudo npm install n -g
version is:`-- n#2.1.4
*following commands are used to run nodejs program
node
>console.log("Hello World!");
above command print hello world in cmd
ctrl+d is used to terminate from cmd
I am using ubuntu, I have installed npm and Nodejs in order to install gulp. I installed gulp globally using the following command npm install --global gulp, After that I have installed glup in my project using the following command: npm install --save-dev gulp. However, When I try to run the command gulp I receive this error bash: /usr/local/bin/gulp: No such file or directory. I also receive the same error when I try to run this command: gulp --version
Solutions I attempted:
I have run this command ./node_modules/.bin/gulp in order to get gulpfile.js to be executed though. However I still Receive the same error.
I solved this problem by doing the following:
sudo apt-get --purge remove node
sudo apt-get --purge remove nodejs
sudo apt-get install nodejs
sudo ln -s /usr/bin/nodejs /usr/bin/node
Why wont my jslint scan a file in bash?
On a fresh install of kubuntu
I installed node
sudo apt-get install node
Then
sudo apt-get install npm
Then
sudo npm install jslint -g
All installs worked well with no errors
my issue comes when I type: I use tab to auto complete
a#a:~/Desktop$ jslint test.js
a#a:~/Desktop$
it does nothing just creates a new line why? the file clearly has errors
PS proof it all installed
a#a:~/Desktop$ nodejs -v
v0.10.25
a#a:~/Desktop$ npm -v
1.3.10
The issue was that I had installed node and not nodejs as they are two different thing
sudo apt-get install nodejs
I installed Cordova and PhoneGap with npm:
sudo npm install -g cordova
sudo npm install -g phonegap
however, both return the same error message:
/usr/bin/env: node: No such file or directory
it's not finding node or node lib on your path
There different solutions posted here:
https://github.com/joyent/node/issues/3911
A few:
PATH:
appending /usr/local/bin:/usr/bin
putenv('PATH=' . getenv('PATH') . ':/usr/local/bin:/usr/bin');
Symlink:
ln -s /usr/bin/nodejs /usr/bin/node
Installing node legacy:
apt-get install nodejs-legacy
The next command helps:
ln -s /usr/bin/nodejs /usr/bin/node
Create a shortcut in /usr/local (not /usr/bin):
ln -s /usr/bin/nodejs /usr/local/bin/node
According to The Linux Documentation Project, distributions may not install anything in there. It is reserved solely for the use of the local administrator.
This way he/she can be absolutely certain that no updates or upgrades to his distribution will overwrite any extra software he has installed locally.
If you are a full-stack developer requiring later features, I recommend installing the latest Node.JS according Ask Ubuntu instructions.
Remember that Ubuntu 14.04.5 LTS provides Node.JS v0.10.25 (stable).
In your terminal run the following:
sudo apt-get update
sudo apt-get install nodejs
sudo apt-get install npm