arekinath/node-getpass

Read only files created in Windows

Opened this issue · 0 comments

When I install node modules depending on getpass I sometimes get an error like;
npm ERR! path ***path to getpass***** npm ERR! code EPERM npm ERR! errno -4048 npm ERR! syscall scandir npm ERR! Error: EPERM: operation not permitted, scandir '***path to getpass*****' npm ERR! { Error: EPERM: operation not permitted, scandir '***path to getpass*****' npm ERR! stack: 'Error: EPERM: operation not permitted, scandir \'***path to getpass*****', npm ERR! errno: -4048, npm ERR! code: 'EPERM', npm ERR! syscall: 'scandir', npm ERR! path: '***path to getpass*****' } npm ERR! npm ERR! Please try running this command again as root/Administrator.
What happens is that node in windows, if not executed "as admin" has limited permissions on "read only" files, however node seems to create read only files and folders when installing some packages.

My workaround after the error is getting to file manager and un-flagging all files and subfolders under /node_modules and retry install. (in windows command line "cd myprojectpath\node_modules" and "attrib -R /S"

I use Windows 7 Enterprise SP 1, npm 5.30, node 8.1.3

The point is making installing modules available for developers that are not windows local administrators.