Skip to main content

Posts

Showing posts from March, 2017

Install npm packages globally without root access

Image from nodejsblog.com NPM packages can be installed locally under your home directory. With local installation you won't get error permissions while youre trying to install global npm packages. Let's make your computer can run "npm install -g" without root access. First, create npm packages directory mkdir -p ~/.npm-packages Add NPM_PACKAGES variable on your .bashrc file echo NPM_PACKAGES="${HOME}/.npm-packages" >> ${HOME}/.bashrc Add prefix to your npm configuration echo prefix=${HOME}/.npm-packages >> ${HOME}/.npmrc Install latest npm curl -L https://www.npmjs.org/install.sh | sh Add NODE_PATH variable to your .bashrc file echo NODE_PATH=\"\$NPM_PACKAGES/lib/node_modules\:\$NODE_PATH\" >> ${HOME}/.bashrc Update PATH variable echo PATH=\"\$NPM_PACKAGES/bin\:\$PATH\" >> ${HOME}/.bashrc Reload your environment variable source ~/.bashrc Now you can install global npm package...

How to use multiple PHP Version on Ubuntu 16.04

Ubuntu 16.04 came with PHP 7.0 packages. Sometimes we need to use older version of PHP. Bellow is the easiest way to get multiple versions of PHP on your Ubuntu PC's. First, you need to add my PPA repository. Open terminal and execute the following commands: sudo add-apt-repository ppa:agungwidodo/tphp Update your apt cache sudo apt update Finally, install tphp packages sudo apt install tphp After installation you will get application called PHP Switcher. Use these apps to switch your PHP version. This apps using PHP as CLI not as CGI, so you cant run multiple PHP version at same times. Plese leave a comment if you have any issues.