Creating the development environmentInstall virtual box (5.1 at time of writing)
download the dvd image of centOS (7 at time of writing)
Create a VM of the image,
On software selection i used KDE Plasma with internet tools and
i used the KDE desktop with internet and KDE applications and development Tools
enable the network
create a user as well as set the super user password
To enable higher resolution
once set up, from the VM menu: device > insert guest additions CD image
this will act as if a cd was inserted into the VM
in the VBOXADDITIONS drive double click autorun.sh and enter your superuser password
Installing npm, node and webstormWithin a terminal window
yum install epel-release
yum install npm
Extract the folder to the place you want to install webstorm
double click webstorm.sh to install
remember to chose a dark theme ;-)
Create your first hello world node app with expressIn a terminal (not as root)
take all the defaults
npm install express --save
Im not going to go into the the how to create a basic express app to echo something to the console and to the browser, there are so many tutorials about that out there.
Enjoy your new development environment.
Major learnings. I.e. Don't do this at work...
When you enter sudo for the first time you get the apt warning:
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
The first time I created the hello world app from the guide above I used su for everything, including creating the folders and npm init. This resulted in files and folders that i could not write to from webstorm so i tried to fix the permissions with chmod. But I used it very very wrongly and the interwebs advised me to reinstall everything. Which as it happens, this time was not a big deal for me.
So what did i do?
Whilst i was su i think i ran:
chmod 777 /. -R
In powershell .\ is the current directory, I thought ./ would be the same in linux but i did a typo and so i ended up making all the files and folders (on the whole VM) 777 rather than just the new code folders. Apparently this is very hard to fix.
The symptom is you type the command su - you get the error:
su: cannot set groups: Operation not permitted
It can make things rather difficult if you cant get root access anymore.
Should it be this easy to screw your entire VM? or was there actually an easy fix? if you know id love to hear about it.