truffle icon indicating copy to clipboard operation
truffle copied to clipboard

Truffle installation Error

Open BCEivan opened this issue 2 years ago • 7 comments

ivan@IvandeMacBook-Air ~ % npm install -g truffle
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm ERR! code EACCES
npm ERR! syscall rename
npm ERR! path /usr/local/lib/node_modules/truffle
npm ERR! dest /usr/local/lib/node_modules/.truffle-ojTgnptm
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, rename '/usr/local/lib/node_modules/truffle' -> '/usr/local/lib/node_modules/.truffle-ojTgnptm'
npm ERR!  [Error: EACCES: permission denied, rename '/usr/local/lib/node_modules/truffle' -> '/usr/local/lib/node_modules/.truffle-ojTgnptm'] {
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'rename',
npm ERR!   path: '/usr/local/lib/node_modules/truffle',
npm ERR!   dest: '/usr/local/lib/node_modules/.truffle-ojTgnptm'
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/ivan/.npm/_logs/2022-07-13T23_17_28_060Z-debug-0.log

BCEivan avatar Jul 14 '22 06:07 BCEivan

how should i do with these problem, thx for helping in davance

BCEivan avatar Jul 14 '22 06:07 BCEivan

Looks like there are some permissions errors, I would recommends re-installing Node and npm with a Node version manager like nvm and this is, in fact, what npm recommends. Usually this resolves these types of errors. See this article from npm for more information on doing this.

eggplantzzz avatar Jul 14 '22 16:07 eggplantzzz

@Kipkurui-mutai in this case I highly doubt downgrading the version will work as this one is a permissions error. In general we don't really recommending downgrading.

eggplantzzz avatar Jul 20 '22 14:07 eggplantzzz

@eggplantzzz I had the same issue during installation. Used that code and it worked.

Kipkurui-mutai avatar Jul 20 '22 14:07 Kipkurui-mutai

@Kipkurui-mutai are you sure it was the same? Did it say "permission denied"? I would be very surprised if that worked for the above error. There are other installation issues that I do believe downgrading would just happen to solve, just not this particular one.

eggplantzzz avatar Jul 20 '22 14:07 eggplantzzz

@eggplantzzz mine was on windows, this one is probably on mac

Kipkurui-mutai avatar Jul 21 '22 03:07 Kipkurui-mutai

If you're still having permissions problem, can you report what npm doctor finds?

cds-amal avatar Aug 04 '22 13:08 cds-amal

Hi @Kipkurui-mutai it looks like we haven't heard from you on this issue in a while. Are you still experiencing an installation error? I am going to go ahead and close this for issue maintenance. If you encounter this or another error please feel free to open a new issue. Thanks!

fainashalts avatar Sep 07 '22 21:09 fainashalts