Tuesday 18 June 2019

Node/NPM, Windows, and Permissions Errors.

Hello /r/node,My apologies if this is not an appropriate place to post this. Recently at work due to security requirements I had to switch away from Arch Linux dev laptop and start using a Windows OS. This is fine as I am fairly familiar with Windows, however I am NOT familiar with Windows permissions.I installed the latest LTS for Windows. Made sure it was in my path. So I can use node/npm from CMD/Powershell/CMDer etc. However I run into some fairly annoying permissions issues.The first issue is when running ng build --watch with nodemon within an Angular project I will get this error:> concurrently --kill-others "ng build --watch" "nodemon -e js,html,json,ts,map server.js" [1] [nodemon] 1.19.1 [1] [nodemon] to restart at any time, enter `rs` [1] [nodemon] watching: *.* [1] [nodemon] starting `node server.js` [1] [INFO] Running on port: 5000 [0] ENOTEMPTY: directory not empty, rmdir 'C:\Users\user\Dev\admin\dist\admin\assets\fonts' [0] Error: ENOTEMPTY: directory not empty, rmdir 'C:\Users\user\Dev\admin\dist\admin\assets\fonts' [0] at Object.rmdirSync (fs.js:684:3) I can get around this by deleting the `dist/` folder and all it's contents EACH TIME before I run the project. However I shouldn't have to do that, and certainly never had to on Linux/OSX.The other issues are basically any IDE I end up using I can't run the project from the built in terminals, or run their debuggers as they almost always hit a permission issue in the `node_modules` folder.npm ERR! path C:\Users\user\Dev\api\node_modules\propex\package.json.3101012362 npm ERR! code EPERM npm ERR! errno -4048 npm ERR! syscall rename npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\user\Dev\api\node_modules\propex\package.json.3101012362' -> 'C:\Users\user\Dev\api\node_modules\propex\package.json' I have tried a few things, including looking at the project folders and opening the properties and trying to mess with permissions with zero luck. I have also popped open the linux subsystem and went with the nuclear option of chmod 777 -R ./* in my dev folder. Like I expected though this had no affect since windows doesn't do their permissions like Linux/OSX.tl;dr how do I fix permissions on my dev folder and subfolders in windows to allow my terminals and IDE's to access any of the files without permissions issues.

Submitted June 18, 2019 at 07:29PM by j-cron

No comments:

Post a Comment