devenv
devenv copied to clipboard
npm install -g failed
Describe the bug
When I install a programme with npm like :
npm install -g <APP>
It failed. I've got an error forbidden :
npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /nix/store/bkb1nlibmvz2iys8b6lmb386yr021nlv-nodejs-16.20.2/lib/node_modules/generator-ngx-rocket
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir '/nix/store/bkb1nlibmvz2iys8b6lmb386yr021nlv-nodejs-16.20.2/lib/node_modules/generator-ngx-rocket'
npm ERR! [Error: EACCES: permission denied, mkdir '/nix/store/bkb1nlibmvz2iys8b6lmb386yr021nlv-nodejs-16.20.2/lib/node_modules/generator-ngx-rocket'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/nix/store/bkb1nlibmvz2iys8b6lmb386yr021nlv-nodejs-16.20.2/lib/node_modules/generator-ngx-rocket'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/pkbp512/.npm/_logs/2023-09-19T09_03_45_878Z-debug-0.log
To reproduce
launch a terminal go to project and do : npm install -g generator-ngx-rocket
Version
devenv: 0.6.3
Running npm config set prefix / should fix it.
What can be done in this regard to automate this step as part of devenv shell first run?
@mahmoudajawad why do you need to globally install something?
@domenkozar, many javascript frameworks have CLI tooling that is provided separately from the actual framework elements. If installing the tooling is not possible with devenv, then the environment user would still be required to install npm (or any package manager), then install the CLI tools in order to have complete experience.
Does devenv suggest different workflow?
It's to install the tooling locally and export PATH to make it available within the shell.
@domenkozar I see. This means different folder structure in some cases (some CLIs conflict with project files). But, overall it makes sense.