OSX Mountain Lion Cloud 9 install instructions - macos

How can I install cloud9 locally on osx mountain lion?
following the instructions at https://github.com/ajaxorg/cloud9/ did not work.

You should check your nodejs version node --version. Use a version lower than 0.8.x
If you are already using 0.10.x and don't intend to go backwards, then you should try nvm:
curl https://raw.github.com/creationix/nvm/master/install.sh | sh
open a new terminal window (or do a shell logout + login)
nvm install 0.8
nvm use 0.8
Then follow cloud9 instructions
git clone https://github.com/ajaxorg/cloud9.git
cd cloud9
npm install
If this doesn't work try updating npm by executing npm update -g
NOTE: if you get EACCES errors then you should probably try sudo npm update -g

Ok, finally figured it out:
Using
node --version = v0.10.5
npm --version = 1.2.18
npm install cloud9
edit node_modules/cloud9/bin/cloud9.js
goto line 42
where: require("cloud9").main(options);
change to: require("../server/cloud9").main(options);
./node_modules/cloud9/bin/cloud9.sh
Haven't found any errors yet, but only just started using it.

Related

How to fix "zsh: command not found: vue"?

I installed #vue/cli on my mac, but whenever I type “vue”, my terminal says “zsh: command not found: vue” - How can I fix this problem? I searched similar issues and already spent half a day, but still not solved...
This is my environment:
macOS Catalina version 10.15
npm 6.4.1
node v10.13.0
I changed $PATH by doing this:
echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.zshrc
Now this is:
echo $PATH
/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Library/Apple/bin:/usr/local/share/dotnet:/opt/X11/bin:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands
It looks like #vue/cli is installed, but I don't know why vue command is not found. Don't I have an admin privilege?
~ % npm install -g #vue/cli
/Users/ami/.npm_global/bin/vue -> /Users/ami/.npm_global/lib/node_modules/#vue/cli/bin/vue.js
+ #vue/cli#4.0.5
updated 1 package in 46.758s
~ % node -v
v10.13.0
~ % npm -v
6.4.1
~ % vue -v
zsh: command not found: vue
~ % vue create new-project
zsh: command not found: vue
I'm following Vue CLI's instruction, so the result is supposed to be creating a new vue project.
https://cli.vuejs.org
SOLVED
Thank you for your advice!
I tried ~ % export PATH=~/.npm_global/bin:$PATH and my path became:
~ % echo $PATH
/Users/ami/.npm_global/bin
:/usr/local/bin
:~/.npm_global/bin
:/usr/local/bin
:~/.npm_global/bin
:/usr/local/bin
:/usr/bin
:/bin
:/usr/sbin
:/sbin
:/Library/Apple/usr/bin
:/Library/Apple/bin
:/usr/local/share/dotnet
:/opt/X11/bin:~/.dotnet/tools
:/Library/Frameworks/Mono.framework/Versions/Current/Commands
And try again:
~ % vue --version
#vue/cli 4.0.5
Worked!
the first you should remove all vue cli by enter 2 command
sudo npm uninstall --global vue-cli
sudo npm uninstall --global #vue/cli
then you should enter this commad for install the latest version of vue cli
sudo npm install --global #vue/cli#latest
I tried this in mac os 10.15.4 and worked
and then I install
#vue/cli 4.4.6
good luck :)
You have to change the .zhsrc in /Users/[username]/.zshrc and add:
export PATH=$PATH:/Users/[username]/.npm-global/bin
Check that your packages are in npm-global or npm-packages.
To see hidden file use cmd+shift+.
if none of the above work
npm config set prefix /usr/local
and
npm install -g #vue/cli
that's worked for me
I tried all of the above to no avail on Catalina 10.15.4
The fix is to
uninstall Node and Npm
go to Downloads Node.js and install the 64-bit version from Package
sudo npm install --global vue-cli
vue -V
2.9.6
mac os catalina with zsh terminal
Uninstalled node and npm using https://www.positronx.io/how-to-uninstall-node-js-and-npm-from-macos/
Downloaded node/npm from https://nodejs.org/en/download/current/
sudo npm install -g #vue/cli
vue --version (#vue/cli 4.5.4)
Open /etc/paths file with nano or some other editor as a superuser (sudo nano /etc/paths).
Add following line at the bottom
/usr/local/Cellar/node/15.2.1/bin
Before that, just check the node version (mine is 15.2.1).
Save changes, reboot your laptop and you're ready to go.

how to update npm on macOS

For reasons unknown to me, I haven't been able to update to the latest version of npm on macOS (it works fine on Windows). It displays no error, only 'updated 1 package'.
Using Node.js 8.11.1
node -v
v8.11.1
What version of npm do I have?
$ npm -v
5.6.0
I tried this...
$ npm i -g npm
+ npm#5.8.0
updated 1 package in 7.37s
And it fails to update.
$ npm -v
5.6.0
Where is npm?
$ which npm
/usr/local/bin/npm
So I try brew...
brew install npm
And it fails...
$ npm -v
5.6.0
*And then I tried this... *
npm install npm#latest -g
+ npm#5.8.0
updated 1 package in 7.618s
And it fails...
npm -v
5.6.0
With sudo:
sudo npm i -g npm
+ npm#5.8.0
updated 1 package in 7.794s
And it fails...
npm -v
5.6.0
This also fails...
sudo npm install npm#latest -g
I followed the directions found on this Q&A, completely removing npm and node from my system and reinstalling them from scratch, and it also fails to update.
Screenshot, per request:
Close the terminal, and then re-open the terminal and running:
$ npm -v
5.6.0
sudo twice:
$ sudo npm i -g npm
+ npm#5.8.0
updated 1 package in 7.478s
$ sudo npm i -g npm
+ npm#5.8.0
updated 1 package in 7.434s
Also fails:
$ npm -v
5.6.0
What did I miss? What's going on here?
This works on my mac.
Based on docs https://docs.npmjs.com/troubleshooting/try-the-latest-stable-version-of-npm :
npm install -g npm#latest
There is a note stated on the docs that depends on your installation method, you might addd some sudo.
Upgrading on *nix (OSX, Linux, etc.)
(You may need to prefix these commands with sudo, especially on Linux,
or OS X if you installed Node using its default installer.)
npm install -g npm#latest
works fine!!
and you can also replace the latest for specific versions
like
npm install -g npm#5.6.0
I hope it will help!!!
Perhaps you have already solved this, but here is what I found when I had exactly this issue. I had 2 versions of npm installed.
I verified this as follows:
grep \"version\" ~/.npm-packages/lib/node_modules/npm/package.json
"version": "6.2.0"
grep \"version\" /usr/local/lib/node_modules/npm/package.json
"version": "5.6.0",
I worked around the issue by updating the path in my bash profile, but would like to know why (how) I ended up with 2 versions. Here is the update:
tail -2 ~/.bash_profile
NPM_PACKAGES="${HOME}/.npm-packages"
PATH="$NPM_PACKAGES/bin:$PATH"
In my case, none of the previous answers worked. For me, a working solution was a simple, five-step process.
Make sure (the old version of) npm is installed.
npm -v
If npm is not installed, then install it on the Mac with Node.js.
Globally installed the desired version of npm.
npm install -g npm#latest
This command uses the old version of npm (installed by Node), to globally install the latest version of npm at ~/.npm-global/. Once installed, close and open a new terminal shell.
Remove the old version of npm installed by Node
rm -r /usr/local/lib/node_modules/npm/
Sometimes this doesn't work, so I had to go into finder to delete the /npm/ folder.
Make sure to set the correct path variable.
echo $PATH
If ~/.npm-global/bin does not show up between the colons, then update the path variable. Open up ~/.zshrc in a text editor and add the following line. If you don't use zsh, open the profile for your corresponding shell (i.e. ~/.bash_profile)
export PATH=$PATH:$HOME/.npm-global/bin
Save your changes and close the text editor.
Close and reopen the terminal shell and run npm -v to check that npm is correctly on the latest version.
The reason for updating the path variable is because the npm cli suggests you update npm with npm install -g npm which will install npm at a different location than where Node installs npm originally.
In my case, only the following has helped:
sudo rm -rf /usr/local/lib/node_modules
sudo rm -rf ~/.npm
brew uninstall --ignore-dependencies node
brew install node
EDIT NOV 21: These days, I bypass brew entirely and use "n":
https://www.npmjs.com/package/n
And so I can change between versions too.
I faced the same problem.
You might have already installed the npm version, and now it is time to point the new npm version install. You can do that by following below steps.
sudo nano /usr/local/lib/node_modules/npm/package.json
change "version" : "5.6.0" to "verison": "5.8.0"
In my case, I'm using nvm to manage different versions of node. In order to upgrade npm version, I have to
1 - Install the latest version of npm by navigating to your current
version of node
cd ~/.nvm/versions/node/v10.9.0
npm install npm
or you can probably use
nvm install-latest-npm
2 - Edit $PATH to point to your current version of node
NPM_PACKAGES="${HOME}/.nvm/versions/node/v10.9.0"
PATH="$NPM_PACKAGES/bin:$PATH"
On my macOS the homebrew-installed npm did not want to upgrade due to pre-existing link file. I ran the install with --force flag and now things are okay.
$ npm --version
6.14.16
$ npm install -g npm#8
npm ERR! EEXIST: file already exists, symlink ...
$ npm install -g --force npm#8
npm WARN using --force I sure hope you know what you are doing.
+ npm#8.19.2
$ npm --version
8.19.2
Note also that in my case, no 'sudo' was required, thanks to homebrew. To check if your npm is installed with homebrew, use brew list.
$ brew list | grep node
node#12

Install Ionic Cordova Error

I am trying to install Ionic 2 on a OSx machine. I did install Node.js. When I run the following:
$ npm install -g ionic cordova
I get this error:
If anyone can assist, I would appreciate it.
UPDATE:
Downgraded Node to v6.9.1 and still get the same error:
UPDATE
As suggested below, I tried:
npm cache clean
But still get the same error:
UPDATE
If I try install a specific version, I get the following error:
sudo npm install -g ionic#2.0.0-beta.20 cordova
to install ionic in mac
you have to install nodejs .
to install ionic as per the official doc if you are using linux or mac you should use sudo command
try
sudo npm install -g ionic cordova
note
your npm version should be greater then 3.x
that version of node its the current so maybe its nos stable at all. I recommend to instal NVM (node version manager) from here this is like a "sand-box" where you have all node version you want and can switch between them.
You only need to run nvm install 5.11.0 and nvm will download that node version for you. Then to use a specific node version you need to run nvm use 5.11.0 and thats all.
I recommend to install 5.11.0 for example, its the node version that im using atm and its working fine with ionic2 RC3.
After downgrading your node.js clean npm cache.
npm cache clean
and try the installation again

PhoneGap Mac CLI local install failed because of Node version

So I want to debug my Phonegap webapp locally in Xcode.
I follow the step here and here, and launch in MAC CLI
$ sudo npm install -g phonegap
BUT install failed and CLI result get lots of errors with the first one is :
engine phonegap#2.9.0rc1-0.12.0: wanted: {"node":">=0.10.0"} (current: {"node":"v0.8.8","npm":"1.1.59"})
I understand my node version is too old : 0.8.8
node --version
I try to update but I am stuck with those 2 methods here and both in errors for me :
BREW
Tried Homebrew but did not work :
$ brew upgrade node
Error: node-0.8.8 already installed
NPM
As I found here
Upgrading Node.js to latest version
How do I update Node.js?
$ sudo npm install -g n
$ sudo n stable
sudo: n: command not found
In fact my bash_profile was missing the path to the n module as I found here:
cannot install npm? problems generating application
Edit your ~/.bash_profile. Add this export somewhere.
export PATH=/usr/local/bin:$PATH:/usr/local/share/npm/bin
I had the same issue and fixed it by upgrading node with brew, I just run
brew install --upgrade node

Upgrade Node.js to the latest version on Mac OS

Currently I am using Node.js v0.6.16 on Mac OS X 10.7.4. Now I want to upgrade it to the latest Node.js v0.8.1. But after downloading and installing the latest package file from nodejs.org, I found that system is still using v0.6.16 instead of v0.8.1 when I typed "node -v" in a terminal. Is there any step that I have missed? Or, should I thoroughly uninstall the old version before installing the latest one?
BTW, I know that nvm can help to manage the nodejs package
https://github.com/creationix/nvm/
Is there any way to upgrade the Node.js without using it?
I have googled this problem, but it seems to me that there is no very clear answer to this question for the latest Node.js.
Here's how I successfully upgraded from v0.8.18 to v0.10.20 without any other requirements like brew etc, (type these commands in the terminal):
sudo npm cache clean -f (force) clear you npm cache
sudo npm install -g n install n (this might take a while)
sudo n stable upgrade to the current stable version
Note that sudo might prompt your password.
Additional note regarding step 3: stable can be exchanged for latest, lts (long term support) or any specific version number such as 0.10.20.
If the version number doesn't show up when typing node -v, you might have to reboot.
These instructions are found here as well: davidwalsh.name/upgrade-nodejs
More info about the n package found here: npmjs.com/package/n
More info about Node.js' release schedule: github.com/nodejs/Release
If you initially installed Node.js with Homebrew, run:
brew update
brew upgrade node
npm install -g npm
Or as a one-liner:
brew update && brew upgrade node && npm install -g npm
A convenient way to change versions is to use n:
brew install n
To install the latest version of Node.js with n:
n latest
Or, to install the latest LTS version with n:
n lts
Alternatively, you could use nvm instead of n:
brew install nvm
To install the latest version of Node.js with nvm:
nvm install node
If you installed via a package, then download the latest version from nodejs.org.
See Installing Node.js and updating npm.
Because this seems to be at the top of Google when searching for how to upgrade nodejs on mac I will offer my tip for anyone coming along in the future despite its age.
Upgrading via NPM
You can use the method described by #Mathias above or choose the following simpler method via the terminal.
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
After which you may opt to confirm the upgrade
node -v
Your nodejs should have upgraded to the latest version. If you wish to upgrade to a specific one say v0.8.19 then instead of
sudo n stable
use
sudo n 0.8.19
EDIT
Avoid using sudo unless you need to. Refer to comment by Steve in the comments
Go to http://nodejs.org and download and run the installer.
It works now - for me at least.
You could install nvm and have multiple versions of Node.js installed.
curl https://raw.github.com/creationix/nvm/master/install.sh | sh
source ~/.nvm/nvm.sh
and then run:
nvm install 0.8.22 #(or whatever version of Node.js you want)
you can see what versions you have installed with :
nvm list
and you can change between versions with:
nvm use 0.8.22
The great thing about using NVM is that you can test different versions alongside one another. If different apps require different versions of Node.js, you can run them both.
I use Node version manager (called n) for it.
npm install -g n
then
n latest
OR
n stable
Simply go to node JS Website and install the latest version.
Do install latest version instead of the recommended stable version. It will give you freedom to use latest ES6 Features on node.
Can be Found here Node JS.
also to update npm, you will have to use this command.
sudo npm i -g npm#latest
All your projects will work fine.
Update: 2020 another good option is to use nvm for node which can then support multiple versions.
use nvm install --lts to always be able to update to latest node version use nvm ls-remote command to to check new versions of node.
Other option for mac :: brew update && brew install node && npm -g npm
Upgrade the version of node without installing any package, not even nvm itself:
sudo npx n stable
Explanations:
This approach is similar to Johan Dettmar's answer. The only difference is here the package n is not installed glabally in the local machine.
On macOS the homebrew recommended way is to run
brew install node
npm install -g npm#latest
I am able to upgrade the node using following command
nvm install node --reinstall-packages-from=node
There are five different ways (and counting?) to update Node.js on Mac:
Install the newer binary by downloading from nodejs.org
Update Node.js through Homebrew
Command: brew update && brew upgrade node
Update Node.js using Node Version Manager (NVM)
Command: nvm install {version} && nvm use {version}
Update Node.js using n package manager
Command: sudo n latest
Update Node.js through MacPorts
Command (same version update): sudo port selfupdate && sudo port upgrade {version}
If you are still using older MacOS version, it may be better to use lightweight, special-purpose package manager like n or nvm. You can refer to this sample use case for updating Node.js on old Mac (High Sierra).
Now this works for me:
sudo npm install -g n
sudo n latest
Happy code!
sadly, n doesn't worked for me. I use node version manager or nvm and it works like a charm. heres the link on how to install nvm: https://github.com/creationix/nvm#installation
nvm i 8.11.2 upgrade to latest LTS
nvm use 8.11.2 use it
node -v check your latest version
Go to the website nodejs.org and download the latest pkg then install.
it works for me
I used brew to upgrade my node. It has installed but it located in /usr/local/Cellar/node/5.5.0 and there is a default node in /usr/local/bin/node which bothers me. I don't want to make soft link because I don't really know how brew is organized.
So I download the pkg file, installed and I got this info:
Node.js was installed at
/usr/local/bin/node
npm was installed at
/usr/local/bin/npm
Make sure that /usr/local/bin is in your $PATH.
Now the upgrade is completed
Pretty Simple.
sudo npm i -g n
Then you can specify the version you want.
sudo n 12.8.0
Cheers!!
You can run but you can't hide... At the end you will be using NVM anyways.
You can just go to nodejs.org and download the newest package. It will update appropriately for you. NPM will be updated as well.
I think the simplest way to use the newest version of Node.js is to get the newest Node.js pkg file in the website https://nodejs.org/en/download/current/
if you want to use different version of Node.js you can use nvm or n to manage it.
sudo npm install -g n
and then
sudo n latest for linux/mac users
For Windows please reinstall node.
These 2 methods I tried are not working:
Use npm
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
Manual install node from official website (https://nodejs.org/en/)
After trying, node -v still shows the old version of node.
Below method works for me:
Step 1: Install nvm (for more details: https://github.com/creationix/nvm#installation)
Open terminal and type this command:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
Close terminal and reopen it.
Type this command to check if nvm is installed:
command -v nvm
Step 2: To download, compile, and install the latest release of node, type this:
nvm install node ("node" is an alias for the latest version)
To check if node gets the latest version (v10.11.0).
Installing the latest node also installs the latest npm.
Check if npm gets the latest version (6.4.1).
Easy nad Safe Steps
Step 1: Install NVM
brew install nvm
Step 2: Create a directory for NVM
mkdir ~/.nvm/
Step 3: Configure your environmental variables
nano ~/.bash_profile
PASTE BELOW CODE
export NVM_DIR=~/.nvm
source $(brew --prefix nvm)/nvm.sh
source ~/.bash_profile
Step 4: Double check your work
nvm ls
Step 5: Install Node
nvm install 9.x.x
Step6: Upgrade
nvm ls-remote
v10.16.2 (LTS: Dubnium)
v10.16.3 (Latest LTS: Dubnium) ..........
nvm install v10.16.3
Troubleshooting
Error Example #1
rm -rf /usr/local/lib/node_modules
brew uninstall node
brew install node --without-npm
echo prefix=~/.npm-packages >> ~/.npmrc
curl -L https://www.npmjs.com/install.sh | sh
https://www.chrisjmendez.com/2018/02/07/install/
Nvm
Nvm is a script-based node version manager. You can install it easily with a curl and bash one-liner as described in the documentation. It's also available on Homebrew.
Assuming you have successfully installed nvm. The following will install the latest version of node.
nvm install node --reinstall-packages-from=node
The last option installs all global npm packages over to your new version. This way packages like mocha and node-inspector keep working.
N
N is an npm-based node version manager. You can install it by installing first some version of node and then running npm install -g n.
Assuming you have successfully installed n. The following will install the latest version of node.
sudo n latest
Homebrew
Homebrew is one of the two popular package managers for Mac. Assuming you have previously installed node with brew install node. You can get up-to-date with formulae and upgrade to the latest Node.js version with the following.
1 brew update
2 brew upgrade node
MacPorts
MacPorts is the another package manager for Mac. The following will update the local ports tree to get access to updated versions. Then it will install the latest version of Node.js. This works even if you have previous version of the package installed.
1 sudo port selfupdate
2 sudo port install nodejs-devel
for latest release:
nvm install node
specific version:
nvm install 6.14.4
https://github.com/creationix/nvm
Use nvm to upgrade node as per the project requirement..
install nvm through homebrew..
brew update
brew install nvm
mkdir ~/.nvm
nano ~/.bash_profile
In your .bash_profile file (you may be using an other file, according to your shell), add the following :
export NVM_DIR=~/.nvm
source $(brew --prefix nvm)/nvm.sh
source ~/.bash_profile
echo $NVM_DIR
You can directly use curl to upgrade node to the latest version. Run the following command:
curl "https://nodejs.org/dist/latest/node-${VERSION:-$(wget -qO- https://nodejs.org/dist/latest/ | sed -nE 's|.*>node-(.*)\.pkg</a>.*|\1|p')}.pkg" > "$HOME/Downloads/node-latest.pkg" && sudo installer -store -pkg "$HOME/Downloads/node-latest.pkg" -target "/"
Reference: https://nodejs.org/en/download/package-manager/#macos
First install nvm with this command:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
credirts to #Saviah Kao
Then install node:
nvm install node --reinstall-packages-from=node
credits to #Elad
I had the same problem. This is what worked for me because I downloaded and installed node.js globally from the node.js website.
What I did was Give NVM (Node Version Manager) a try. Please do the commands in the following order in your terminal
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
command -v nvm
nvm install node
node -v (to confirm the update)
This is just to add some info for people who didn't have Node installed with Homebrew but getting that very error when trying to install packages with npm on Mac OS X.
I found this good article explaining how to completely remove Node whichever the way you originally installed it.
After node, npm and n were completely removed from my machine, I just reinstalled Node.js using the official .pckg installer from Node website and everything just went back to normal.
Hope this helps out someone.
An easy way is go straight to the website
https://nodejs.org/en/download/
Click download the latest version and install pkg file.
After that you will get the latest node and npm version
I'm using a Mac Mini M1. I just removed my very old packages of node.js and npm and decided to install them using homebrew. I found out that now brew install node also installs npm. FYI

Resources