truffle
truffle copied to clipboard
Truffle installation Error
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
how should i do with these problem, thx for helping in davance
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.
@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 I had the same issue during installation. Used that code and it worked.
@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 mine was on windows, this one is probably on mac
If you're still having permissions problem, can you report what npm doctor
finds?
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!