I get the following error when trying to run any npm/gulp command in Git Bash/PS
npm install
internal/fs/utils.js:269
throw err;
^
Error: EPERM: operation not permitted, lstat 'C:\Users\<admin user account>'
←[90m at Object.realpathSync (fs.js:1646:7)←[39m
←[90m at toRealPath (internal/modules/cjs/loader.js:336:13)←[39m
←[90m at Function.Module._findPath (internal/modules/cjs/loader.js:492:22)←[39m
←[90m at resolveMainPath (internal/modules/run_main.js:12:25)←[39m
←[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:54:24)←[39m
←[90m at internal/main/run_main_module.js:17:47←[39m {
errno: ←[33m-4048←[39m,
syscall: ←[32m'lstat'←[39m,
code: ←[32m'EPERM'←[39m,
path: ←[32m'C:\\Users\\<admin user account>'←[39m
}
internal/fs/utils.js:269
throw err;
^
Error: EPERM: operation not permitted, lstat 'C:\Users\<admin user account>'
←[90m at Object.realpathSync (fs.js:1646:7)←[39m
←[90m at toRealPath (internal/modules/cjs/loader.js:336:13)←[39m
←[90m at Function.Module._findPath (internal/modules/cjs/loader.js:492:22)←[39m
←[90m at resolveMainPath (internal/modules/run_main.js:12:25)←[39m
←[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:54:24)←[39m
←[90m at internal/main/run_main_module.js:17:47←[39m {
errno: ←[33m-4048←[39m,
syscall: ←[32m'lstat'←[39m,
code: ←[32m'EPERM'←[39m,
path: ←[32m'C:\\Users\\<admin user account>'←[39m
}
I have my environment variables set up for my Path to point to the nodejs folder in Program Files for both my admin and regular user account but can still only run npm and gulp commands as an admin. This happens in any location on that C drive but other commands (eg. dotnet, node) work fine in both users.