Friday, May 17, 2024
 Popular · Latest · Hot · Upcoming
65
rated 0 times [  69] [ 4]  / answers: 1 / hits: 65672  / 11 Years ago, thu, january 2, 2014, 12:00:00

I installed node js and npm via apt-get install and all of the dependencies, then I installed browserify



npm install browserify -g


it goes through the process and it seems like it installed correctly, but when I try to do a simple bundle per this walkthrough



I get the error:



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



enter


More From » node.js

 Answers
20

You can also install Nodejs using NVM or Nodejs Version Manager. There are a lot of benefits to using a version manager. One of them being you don't have to worry about this issue.






Instructions:






sudo apt-get update
sudo apt-get install build-essential libssl-dev


Once the prerequisite packages are installed, you can pull down the nvm installation script from the project's GitHub page. The version number may be different, but in general, you can download and install it with the following syntax:



curl https://raw.githubusercontent.com/creationix/nvm/v0.16.1/install.sh | sh


This will download the script and run it. It will install the software into a subdirectory of your home directory at ~/.nvm. It will also add the necessary lines to your ~/.profile file to use the file.



To gain access to the nvm functionality, you'll need to log out and log back in again, or you can source the ~/.profile file so that your current session knows about the changes:



source ~/.profile


Now that you have nvm installed, you can install isolated Node.js versions.



To find out the versions of Node.js that are available for installation, you can type:



nvm ls-remote
. . .

v0.11.10
v0.11.11
v0.11.12
v0.11.13
v0.11.14


As you can see, the newest version at the time of this writing is v0.11.14. You can install that by typing:



nvm install 0.11.14


Usually, nvm will switch to use the most recently installed version. You can explicitly tell nvm to use the version we just downloaded by typing:



nvm use 0.11.14


When you install Node.js using nvm, the executable is called node. You can see the version currently being used by the shell by typing:



node -v


The comeplete tutorial can be found here


[#73422] Wednesday, January 1, 2014, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
kiyam

Total Points: 448
Total Questions: 96
Total Answers: 92

Location: Philippines
Member since Sat, Jul 11, 2020
4 Years ago
;