im having trouble installing truffle. ive tried root/Administrator but then i get this. if anyone has any guidance that would greatly be appreciated.
this is what im getting.
% npm install -g truffle
npm error code EACCES
npm error syscall mkdir
npm error path /usr/local/lib/node_modules/truffle
npm error errno -13
npm error Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/truffle'
npm error at async mkdir (node:internal/fs/promises:858:10)
npm error at async /usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:624:20
npm error at async Promise.allSettled (index 0)
npm error at async [reifyPackages] (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:325:11)
npm error at async Arborist.reify (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:142:5)
npm error at async Install.exec (/usr/local/lib/node_modules/npm/lib/commands/install.js:150:5)
npm error at async module.exports (/usr/local/lib/node_modules/npm/lib/cli/entry.js:74:5) {
npm error errno: -13,
npm error code: 'EACCES',
npm error syscall: 'mkdir',
npm error path: '/usr/local/lib/node_modules/truffle'
npm error }
npm error
npm error The operation was rejected by your operating system.
npm error It is likely you do not have the permissions to access this file as the current user
npm error
npm error If you believe this might be a permissions issue, please double-check the
npm error permissions of the file and its containing directories, or try running
npm error the command again as root/Administrator.
npm error A complete log of this run can be found in: /Users/prestonlofton/.npm/_logs/2024-07-10T00_46_51_500Z-debug-0.log
prestonlofton@Prestons-Air ~ % sudo rm -rf /Library/Developer/CommandLineTools
Password:
Sorry, try again.
Password:
prestonlofton@Prestons-Air ~ % sudo Xcode-select --install
xcode-select: note: install requested for command line developer tools
prestonlofton@Prestons-Air ~ % npm install -g truffle 5.0.2
npm error code E404
npm error 404 Not Found - GET https://registry.npmjs.org/5.0.2 - Not found
npm error 404
npm error 404 '5.0.2@*' is not in this registry.
npm error 404
npm error 404 Note that you can also install from a
npm error 404 tarball, folder, http url, or git url.
npm error A complete log of this run can be found in: /Users/prestonlofton/.npm/_logs/2024-07-10T00_54_22_459Z-debug-0.log