Tuesday, November 7, 2017

Error: EACCES: permission denied, mkdir 'node_modules/node-sass'



Unable to save binary /usr/lib/node_modules/node-sass/vendor/linux-x64-57 : { Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/node-sass/vendor'
    at Object.fs.mkdirSync (fs.js:891:18)
    at sync (/usr/lib/node_modules/node-sass/node_modules/mkdirp/index.js:71:13)
    at Function.sync (/usr/lib/node_modules/node-sass/node_modules/mkdirp/index.js:77:24)
    at checkAndDownloadBinary (/usr/lib/node_modules/node-sass/scripts/install.js:111:11)
    at Object.<anonymous> (/usr/lib/node_modules/node-sass/scripts/install.js:154:1)
    at Module._compile (module.js:573:30)
    at Object.Module._extensions..js (module.js:584:10)
    at Module.load (module.js:507:32)
    at tryModuleLoad (module.js:470:12)
    at Function.Module._load (module.js:462:3)



You are trying these commands in project directory
sudo npm install node-sass
or
npm install node-sass
and it is giving above error and module is not getting installed.

Solution :

sudo chmod -R 777 projectfolder
Now it has sufficient permission to create files inside it. 
Do not use sudo with npm, it does not need root access to install package(module).
Now Run :
npm install node-sass
Now it will be installed. You can give correct permission to folder and files again, 777 is a security breach. We just made it for installing this module.

Magento Installation Error : set always_populate_raw_post_data to -1

Magento Installation Error :

PHP Settings Check * Need Help? PHP Documentation Your PHP Version is 5.6.30, but always_populate_raw_post_data = 0. $HTTP_RAW_POST_DATA is deprecated from PHP 5.6 onwards and will be removed in PHP 7.0. This will stop the installer from running. Please open your php.ini file and set always_populate_raw_post_data to -1. If you need more help please call your hosting provider.

Solution :
 Open .htaccess file of magento and add line php_value always_populate_raw_post_data -1 between tags <IfModule mod_php5.c> and </IfModule>

<IfModule mod_php5.c>    php_value always_populate_raw_post_data -1
</IfModule>


Now Try to install again. You should not get same error again.

Monday, October 2, 2017

Convert Text into Hexadecimal and Hexadecimal into Text on command line


Convert Text into Hexadecimal using command line :
printf "linux is awesome" | xxd

or

echo -n "linux is awesome" | od -A n -t x1


Convert Hexadecimal into Text using command line:
echo "6c 69 6e 75 78 20 69 73 20 61 77 65 73 6f 6d 65" | xxd -r -p && echo ""