permission denied, mkdir '/usr/local/lib/node_modules/nw-builder/cache'
You're not supposed to write to root's directories. Many developers won't have root permissions in enterprises.
Latest Version: v0.37.4
Using v0.37.4 (sdk)
{ Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/nw-builder/cache'
at Object.fs.mkdirSync (fs.js:885:18)
at mkdirsSync (/usr/local/lib/node_modules/nw-builder/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js:29:9)
at mkdirsSync (/usr/local/lib/node_modules/nw-builder/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js:35:16)
at Object.mkdirsSync (/usr/local/lib/node_modules/nw-builder/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js:35:16)
at /usr/local/lib/node_modules/nw-builder/lib/index.js:298:12
at /usr/local/lib/node_modules/nw-builder/lib/index.js:800:16
at /usr/local/lib/node_modules/nw-builder/node_modules/lodash/lodash.js:4911:15
at baseForOwn (/usr/local/lib/node_modules/nw-builder/node_modules/lodash/lodash.js:2996:24)
at /usr/local/lib/node_modules/nw-builder/node_modules/lodash/lodash.js:4880:18
at Function.forEach (/usr/local/lib/node_modules/nw-builder/node_modules/lodash/lodash.js:9344:14)
errno: -13,
code: 'EACCES',
syscall: 'mkdir',
path: '/usr/local/lib/node_modules/nw-builder/cache' }
use sudo if you are on linux, ex: sudo nwbuild -p win64 ./
You're not supposed to write to root's directories. Many developers won't have root permissions in enterprises.
I see where you're coming from that it is bad practice and an attack vector. I haven't run into this issue myself - I run Ubuntu using WSL. I think the solution would be installing in a directory which does not require sudo. You could use chmod to change the relevant permissions for the directory.
Correct me if I'm wrong but when you say enterprise use case it'll probably be used as a dev dependency in a project which utilities web technologies. The final product would be an executable.
I've answered your concern to the best my knowledge. Let me know if I haven't addressed something.
On second look, #289 may be related.
Closing this in favour of #623.