When I try to install adonis Cli I get permison error - node.js

When I try to install adonis Cli I get this permison error:
npm ERR! path ../lib/node_modules/#adonisjs/cli/index.js
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall symlink
npm ERR! Error: EACCES: permission denied, symlink '../lib/node_modules/#adonisjs/cli/index.js' -> '/usr/bin/adonis'
npm ERR! { Error: EACCES: permission denied, symlink '../lib/node_modules/#adonisjs/cli/index.js' -> '/usr/bin/adonis'
npm ERR! cause:
npm ERR! { Error: EACCES: permission denied, symlink '../lib/node_modules/#adonisjs/cli/index.js' -> '/usr/bin/adonis'
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'symlink',
npm ERR! path: '../lib/node_modules/#adonisjs/cli/index.js',
npm ERR! dest: '/usr/bin/adonis' },
npm ERR! stack: 'Error: EACCES: permission denied, symlink \'../lib/node_modules/#adonisjs/cli/index.js\' -> \'/usr/bin/adonis\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'symlink',
npm ERR! path: '../lib/node_modules/#adonisjs/cli/index.js',
npm ERR! dest: '/usr/bin/adonis' }
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 (though this is not recommended).
npm ERR! A complete log of this run can be found in:
npm ERR! /home/adroitcoder/.npm/_logs/2018-10-06T07_39_51_484Z-debug.log

For EACCES errors you should either reinstall npm with a Node version manager or change npm's default directory manually.
Credit: https://docs.npmjs.com/getting-started/fixing-npm-permissions

Related

Can't update the node version using npm

I ran the command npm install -g n to then install the latest node version, but this came up:
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! [Error: EACCES: permission denied, access '/usr/local/lib/node_modules'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules'
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/runner/.npm/_logs/2021-11-12T19_56_01_886Z-debug.log
Do you know how can I fix it?

Trying to install the latest version of npm but there are problems with permission

I tried it with sudo and cleaned the cache but it still doesn't work, pls help. Thanks! It says that I have no permission to access this file as the current user but who has, i am the only user
npm ERR! code EACCES
npm ERR! syscall rename
npm ERR! path /usr/local/lib/node_modules/.staging/npm-3e479054/node_modules/string-width
npm ERR! dest /usr/local/lib/node_modules/.staging/string-width-fa87d55b
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, rename '/usr/local/lib/node_modules/.staging/npm-3e479054/node_modules/string-width' -> '/usr/local/lib/node_modules/.staging/string-width-fa87d55b'
npm ERR! { [Error: EACCES: permission denied, rename '/usr/local/lib/node_modules/.staging/npm-3e479054/node_modules/string-width' -> '/usr/local/lib/node_modules/.staging/string-width-fa87d55b']
npm ERR! cause:
npm ERR! { Error: EACCES: permission denied, rename '/usr/local/lib/node_modules/.staging/npm-3e479054/node_modules/string-width' -> '/usr/local/lib/node_modules/.staging/string-width-fa87d55b'
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'rename',
npm ERR! path:
npm ERR! '/usr/local/lib/node_modules/.staging/npm-3e479054/node_modules/string-width',
npm ERR! dest: '/usr/local/lib/node_modules/.staging/string-width-fa87d55b' },
npm ERR! stack:
npm ERR! 'Error: EACCES: permission denied, rename \'/usr/local/lib/node_modules/.staging/npm-3e479054/node_modules/string-width\' -> \'/usr/local/lib/node_modules/.staging/string-width-fa87d55b\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'rename',
npm ERR! path:
npm ERR! '/usr/local/lib/node_modules/.staging/npm-3e479054/node_modules/string-width',
npm ERR! dest: '/usr/local/lib/node_modules/.staging/string-width-fa87d55b' }
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! /root/.npm/_logs/2021-04-27T09_59_20_887Z-debug.log
I have the exact same problem. It's not file permissions. Even chmod a+rwX -R ~/.nvm does not help and running the terminal as administrator also does not help. I tried npm i -g jest, and that worked just fine

Unable to install npm packages

I have to install npm package hence used command - npm install -g <package-name> but it resulted into write access error so I changed permissions as follows with refernce to https://flaviocopes.com/npm-fix-missing-write-access-error/
sudo chown -R $USER /opt/node-v10.22.0-linux-x64/lib/node_modules/
and tried again but if failed again -
npm ERR! code EACCES
npm ERR! syscall symlink
npm ERR! path ../lib/node_modules/requirejs/bin/r.js
npm ERR! dest /opt/node-v10.22.0-linux-x64/bin/r.js
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, symlink '../lib/node_modules/requirejs/bin/r.js' -> '/opt/node-v10.22.0-linux-x64/bin/r.js'
npm ERR! { [Error: EACCES: permission denied, symlink '../lib/node_modules/requirejs/bin/r.js' -> '/opt/node-v10.22.0-linux-x64/bin/r.js']
npm ERR! cause:
npm ERR! { Error: EACCES: permission denied, symlink '../lib/node_modules/requirejs/bin/r.js' -> '/opt/node-v10.22.0-linux-x64/bin/r.js'
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'symlink',
npm ERR! path: '../lib/node_modules/requirejs/bin/r.js',
npm ERR! dest: '/opt/node-v10.22.0-linux-x64/bin/r.js' },
npm ERR! stack:
npm ERR! 'Error: EACCES: permission denied, symlink \'../lib/node_modules/requirejs/bin/r.js\' -> \'/opt/node-v10.22.0-linux-x64/bin/r.js\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'symlink',
npm ERR! path: '../lib/node_modules/requirejs/bin/r.js',
npm ERR! dest: '/opt/node-v10.22.0-linux-x64/bin/r.js' }
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.
also when I run command with sudo, it gives npm not found. Please guide what is wrong here.
you need read write permissions to /opt/node-v10.22.0-linux-x64/ as it creates a symlink there for you.
you can also check the destination in error it clearly says you don't have permission there.

npm create-react-app Error: EACCES: permission denied. The operation was rejected by your operating system

I want to use react in vscode but when I try to install node.js it gives me errors. my command is
npm install -g create-react-app
npm ERR! code EACCES
npm ERR! syscall symlink
npm ERR! path ../lib/node_modules/create-react-app/index.js
npm ERR! dest /usr/local/bin/create-react-app
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, symlink '../lib/node_modules/create-react-app/index.js' -> '/usr/local/bin/create-react-app'
npm ERR! [OperationalError: EACCES: permission denied, symlink '../lib/node_modules/create-react-app/index.js' -> '/usr/local/bin/create-react-app'] {
npm ERR! cause: [Error: EACCES: permission denied, symlink '../lib/node_modules/create-react-app/index.js' -> '/usr/local/bin/create-react-app'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'symlink',
npm ERR! path: '../lib/node_modules/create-react-app/index.js',
npm ERR! dest: '/usr/local/bin/create-react-app'
npm ERR! },
npm ERR! stack: "Error: EACCES: permission denied, symlink '../lib/node_modules/create-react-app/index.js' -> '/usr/local/bin/create-react-app'",
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'symlink',
npm ERR! path: '../lib/node_modules/create-react-app/index.js',
npm ERR! dest: '/usr/local/bin/create-react-app'
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! /Users/defneyazicioglu/.npm/_logs/2020-03-23T17_10_48_130Z-debug.log
How can I solve this
Try these commands :
$sudo -s
$npm install -g create-react-app
$exit
$npx create-react-app my-app

npm ERR! Error: EACCES: permission denied, open

I am trying to install on my dependencies from an already existing react project using npm install, however, is giving me this error every time now I try to run npm install.
Does anyone know why is this happening now? I have several projects that I have been working on before installing and uninstalling with no problem at all.
npm WARN deprecated fsevents#2.0.6: Please update: there are crash fixes
npm WARN deprecated left-pad#1.3.0: use String.prototype.padStart()
npm ERR! path /Users/gabrielnessi/.npm/_cacache/index-v5/35/e4/300bcd6d6b07328b3cffb3509f86bc1ac535a870f8fe27c074a299d8c732
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall open
npm ERR! Error: EACCES: permission denied, open '/Users/gabrielnessi/.npm/_cacache/index-v5/35/e4/300bcd6d6b07328b3cffb3509f86bc1ac535a870f8fe27c074a299d8c732'
npm ERR! [OperationalError: EACCES: permission denied, open '/Users/gabrielnessi/.npm/_cacache/index-v5/35/e4/300bcd6d6b07328b3cffb3509f86bc1ac535a870f8fe27c074a299d8c732'] {
npm ERR! cause: [Error: EACCES: permission denied, open '/Users/gabrielnessi/.npm/_cacache/index-v5/35/e4/300bcd6d6b07328b3cffb3509f86bc1ac535a870f8fe27c074a299d8c732'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'open',
npm ERR! path: '/Users/gabrielnessi/.npm/_cacache/index-v5/35/e4/300bcd6d6b07328b3cffb3509f86bc1ac535a870f8fe27c074a299d8c732'
npm ERR! },
npm ERR! isOperational: true,
npm ERR! stack: 'Error: EACCES: permission denied, open ' +
npm ERR! "'/Users/gabrielnessi/.npm/_cacache/index-v5/35/e4/300bcd6d6b07328b3cffb3509f86bc1ac535a870f8fe27c074a299d8c732'",
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'open',
npm ERR! path: '/Users/gabrielnessi/.npm/_cacache/index-v5/35/e4/300bcd6d6b07328b3cffb3509f86bc1ac535a870f8fe27c074a299d8c732',
npm ERR! parent: 'eslint-plugin-jsx-a11y'
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 (though this is not recommended).
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/gabrielnessi/.npm/_logs/2019-06-13T11_28_05_702Z-debug.log```
You probably create your project as root, and now you try to install module on the same folder as a simple user. You need to login as root to give permissions to user, or change the folder owner or delete and recreate your project folder

Resources