Tuesday 13 September 2016

Particle Photon Getting Started


Step 1:
To install Node.js, type the following command in your terminal:
Then install the Node package manager, npm:
Create a symbolic link for node, as many Node.js tools use this name to execute.
Now we should have both the Node and npm commands working:
$ npm install -g particle-cli
Step 2:
sudo npm install -g particle-cli


Ref:
http://www.hostingadvice.com/how-to/install-nodejs-ubuntu-14-04/#ubuntu-package-manager
https://docs.particle.io/guide/tools-and-features/cli/photon/


//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Trouble shooting, after an particle-cli upgrade, I am getting two errors look like:

        /usr/local/lib/node_modules/particle-cli/commands/Key Commands.js:213 

and the other similar one.

This is because the node version is too old. So we have to (1) upgrade node (2) remove particle-cli (3) re-install particle-cli again.

(1) in order to install the latest node
   1 Install npm:
sudo apt-get install npm
  1. Install n
sudo npm install n -g
  1. Get latest version of node
sudo n latest

(2) remove and re-install particle-cli
sudo npm remove -g particle-cli
sudo npm install -g particle-cli


//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

I setup a brand new computer again.

Step 1:
sudo apt-get install nodejs-legacy
sudo apt-get install npm
You wont get the latest version but we are going to upgrade them in a minute.

Step 2:
Update them.
sudo npm cache clean -f
sudo npm install -g n
sudo n latest

Step 3:
bash <( curl -sL https://particle.io/install-cli )
Wait a while and that's IT!!!


ref:
https://github.com/spark/particle-cli/issues/176
http://stackoverflow.com/questions/34974535/install-latest-nodejs-version-in-ubuntu-14-04
http://www.hostingadvice.com/how-to/update-node-js-latest-version/
https://docs.particle.io/guide/tools-and-features/cli/photon/


No comments:

Post a Comment