salesforce / utam-java

UTAM Java implementation
MIT License
25 stars 16 forks source link

[Bug] npm install utam fails with errno -4048 Error: EPERM: operation not permitted, mkdir 'C:\' #212

Closed surfmuggle closed 7 months ago

surfmuggle commented 8 months ago

Actual behavior

On windows i wanted to run

on a command prompt with local admin rigths.

The installation failed (see log extract below).

Bug options

What is your expected behavior?

The installation should not fail. If a certain folder needs to be created an output stating the name of the folder that needs to be created including its path would be helpfull. The user could create the folder manually.

Steps to reproduce

Set up a windows box where the user or certain processes have restricted rights to create folders on the main drive C:\>

Environment

Additional context

See the log

Log 1 from npm install utam --save-dev

This is the logfile content from npm install utam --save-dev

0 verbose cli C:\Program Files\nodejs\node.exe C:\Users\<user-id>\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js
1 info using npm@9.7.1
2 info using node@v18.7.0
3 timing npm:load:whichnode Completed in 2ms
4 timing config:load:defaults Completed in 2ms
5 timing config:load:file:C:\Users\<user-id>\AppData\Roaming\npm\node_modules\npm\npmrc Completed in 3ms
6 timing config:load:builtin Completed in 3ms
7 timing config:load:cli Completed in 1ms
8 timing config:load:env Completed in 0ms
9 timing config:load:file:C:\.npmrc Completed in 1ms
10 timing config:load:project Completed in 2ms
11 timing config:load:file:C:\Users\<user-id>\.npmrc Completed in 1ms
12 timing config:load:user Completed in 1ms
13 timing config:load:file:C:\Users\<user-id>\AppData\Roaming\npm\etc\npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:setEnvs Completed in 1ms
16 timing config:load Completed in 12ms
17 timing npm:load:configload Completed in 13ms
18 timing config:load:flatten Completed in 3ms
19 timing npm:load:mkdirpcache Completed in 0ms
20 timing npm:load:mkdirplogs Completed in 0ms
21 verbose title npm install utam
22 verbose argv "install" "utam" "--save-dev"
23 timing npm:load:setTitle Completed in 1ms
24 timing npm:load:display Completed in 0ms
25 verbose logfile logs-max:10 dir:C:\Users\<user-id>\AppData\Local\npm-cache\_logs\2024-02-23T09_03_11_965Z-
26 verbose logfile C:\Users\<user-id>\AppData\Local\npm-cache\_logs\2024-02-23T09_03_11_965Z-debug-0.log
27 timing npm:load:logFile Completed in 10ms
28 timing npm:load:timers Completed in 0ms
29 timing npm:load:configScope Completed in 0ms
30 timing npm:load Completed in 59ms
31 timing arborist:ctor Completed in 1ms
32 timing command:install Completed in 15ms
33 verbose stack Error: EPERM: operation not permitted, mkdir 'C:\'
34 verbose cwd C:\dev\utam
35 verbose Windows_NT 10.0.19045
36 verbose node v18.7.0
37 verbose npm  v9.7.1
38 error code EPERM
39 error syscall mkdir
40 error path C:\
41 error errno -4048
42 error [Error: EPERM: operation not permitted, mkdir 'C:\'] {
42 error   errno: -4048,
42 error   code: 'EPERM',
42 error   syscall: 'mkdir',
42 error   path: 'C:\\'
42 error }
43 error
43 error The operation was rejected by your operating system.
43 error It's possible that the file was already in use (by a text editor or antivirus),
43 error or that you lack permissions to access it.
43 error
43 error If you believe this might be a permissions issue, please double-check the
43 error permissions of the file and its containing directories, or try running
43 error the command again as root/Administrator.
44 verbose exit -4048
45 timing npm Completed in 579ms
46 verbose unfinished npm timer reify 1708678992517
47 verbose code -4048
48 error A complete log of this run can be found in: C:\Users\<user-id>\AppData\Local\npm-cache\_logs\2024-02-23T09_03_11_965Z-debug-0.log

Log 2 from npm install salesforce-pageobjects --save-dev

This is the logfile content from npm install salesforce-pageobjects --save-dev

0 verbose cli C:\Program Files\nodejs\node.exe C:\Users\<user-id>\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js
1 info using npm@9.7.1
2 info using node@v18.7.0
3 timing npm:load:whichnode Completed in 3ms
4 timing config:load:defaults Completed in 2ms
5 timing config:load:file:C:\Users\<user-id>\AppData\Roaming\npm\node_modules\npm\npmrc Completed in 4ms
6 timing config:load:builtin Completed in 4ms
7 timing config:load:cli Completed in 2ms
8 timing config:load:env Completed in 1ms
9 timing config:load:file:C:\.npmrc Completed in 1ms
10 timing config:load:project Completed in 2ms
11 timing config:load:file:C:\Users\<user-id>\.npmrc Completed in 1ms
12 timing config:load:user Completed in 1ms
13 timing config:load:file:C:\Users\<user-id>\AppData\Roaming\npm\etc\npmrc Completed in 1ms
14 timing config:load:global Completed in 1ms
15 timing config:load:setEnvs Completed in 1ms
16 timing config:load Completed in 15ms
17 timing npm:load:configload Completed in 15ms
18 timing config:load:flatten Completed in 4ms
19 timing npm:load:mkdirpcache Completed in 1ms
20 timing npm:load:mkdirplogs Completed in 1ms
21 verbose title npm install salesforce-pageobjects
22 verbose argv "install" "salesforce-pageobjects" "--save-dev"
23 timing npm:load:setTitle Completed in 6ms
24 timing npm:load:display Completed in 5ms
25 verbose logfile logs-max:10 dir:C:\Users\<user-id>\AppData\Local\npm-cache\_logs\2024-02-23T08_11_30_099Z-
26 verbose logfile C:\Users\<user-id>\AppData\Local\npm-cache\_logs\2024-02-23T08_11_30_099Z-debug-0.log
27 timing npm:load:logFile Completed in 40ms
28 timing npm:load:timers Completed in 0ms
29 timing npm:load:configScope Completed in 0ms
30 timing npm:load Completed in 113ms
31 timing arborist:ctor Completed in 0ms
32 timing command:install Completed in 14ms
33 verbose stack Error: EPERM: operation not permitted, mkdir 'C:\'
34 verbose cwd C:\dev\utam
35 verbose Windows_NT 10.0.19045
36 verbose node v18.7.0
37 verbose npm  v9.7.1
38 error code EPERM
39 error syscall mkdir
40 error path C:\
41 error errno -4048
42 error [Error: EPERM: operation not permitted, mkdir 'C:\'] {
42 error   errno: -4048,
42 error   code: '  ',
42 error   syscall: 'mkdir',
42 error   path: 'C:\\'
42 error }
43 error
43 error The operation was rejected by your operating system.
43 error It's possible that the file was already in use (by a text editor or antivirus),
43 error or that you lack permissions to access it.
43 error
43 error If you believe this might be a permissions issue, please double-check the
43 error permissions of the file and its containing directories, or try running
43 error the command again as root/Administrator.
44 verbose exit -4048
45 timing npm Completed in 807ms
46 verbose unfinished npm timer reify 1708675890883
47 verbose code -4048
48 error A complete log of this run can be found in: C:\Users\<user-id>\AppData\Local\npm-cache\_logs\2024-02-23T08_11_30_099Z-debug-0.log
surfmuggle commented 7 months ago

I have switchted to node v20.7.0 and npm 9.7.1. I changed the path for prefix: npm get prefix returns C:\Users\<myuser>\AppData\Roaming\npm. I tried to run npm update and it failed with the same error basically: EPERM: operation not permitted, mkdir 'C:\'. Then i did run npm install -g npm@latest and now have npm -v 10.4.0. I tried npm install jasmine as local admin and as normal user and it failed with EPERM: operation not permitted, mkdir 'C:\'. So i assume this is an issue with my box and not with utam.