Showing posts with label permission. Show all posts
Showing posts with label permission. Show all posts

How to fix checkPermissions Missing write access to /usr/local/lib/node_modules error ?

If you are working in a Node JS environment and without root access or sudo access, you might get an error as checkPermissions Missing write access to /usr/local/lib/node_modules like below

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/local/lib/node_modules
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR!  [Error: EACCES: permission denied, access '/usr/local/lib/node_modules'] {
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/local/lib/node_modules'
npm ERR! }
npm ERR!

one solution to this problem is changing the permission of the folder /usr/local/lib/node_modules for the current user, but thats not recommended and what if its not in your hands to change the permission.
One thing we can do to address this problem is modify the location where nodejs can store modules, for your user account.
Follow below steps in given order to configure your node_modules folder for your user account with out harming others!!

# Create a directory named npm-global as hidden in your home directory
mkdir ~/.npm-global

# Then set it as your node dir 
npm config set prefix '~/.npm-global'

# Update Path in your .bashrc or .bash_profile or .profile files as below
export PATH="~/.npm-global/bin:$PATH"

# once saved load the changes
source ~/.bashrc

And thats it, we are good. Now you can install any module and you wont be getting any permission related error as above.
Hope it helps.

MacOS: Could not read files copied from external drive to your Mac

While you have successfully copied the data from your external devices particularly from NTFS file system to your MacOS's file system (APFS), you still would need to struggle to access those files later for some reason. Or in certain cases being a super user you may be able to access those files, but not your applications.

Here the three simple steps to fix the issue.

Prerequisite:

Step 1: Install the XCode command line tools.

$ xcode-select --install

Actual commands that fixes the issue:

Step 2: Get the file information like file type, creator, and other file attributes etc. and verify.

GetFileInfo <path to file>
Example: GetFileInfo /Users/venkat/backups/VMDiskFile.vmdk


Step:3 Change it's file permissions by executing

SetFile -c "" -t "" <path to file>
Example: SetFile -c "" -t "" /Users/venkat/backups/VMDiskFile.vmdk

Your file is now accessible by all. Of course you may choose set of permissions as per the requirement. The above command just lifts all the restrictions on the file. 

Vsftpd Response :550 Permission denied.

Hello,

After installing vsftpd you may receive error as

Response:550 Permission denied.


Thats because you havent enabled write permission in your vsftpd.conf file.

in Ubuntu edit ,
/etc/vsftpd.conf
file and make sure you have uncommented 
write_enable=YES
.

in CentOS/RHEL,
/etc/vsftpd.conf
file and make sure you have uncommented
write_enable=YES


Hope it helps.

Thank you.



Restore Permission on Home directory

This Post I am taking from askubuntu , not answered by me but posting in my blog so that it can help others in future.

http://askubuntu.com/questions/567599/emsudo-chmod-x-caused-me-cannot-open-anything

Note: This is the way like doing as undoing what you have done.

sudo chmod -x * -R
find . -type d

You will get an error like below 
find: 'xxxxx': Permission denied 
then do as
find . -type d -exec chmod +x {} \;