错误:EACCES:permission denied,open '/Users/rishikesh/Library/Preferences/truffle-nodejs/config.json.tmp-4644209492910867'

w1jd8yoj  于 2023-05-28  发布在  Node.js
关注(0)|答案(1)|浏览(178)
Error: EACCES: permission denied, open '/Users/rishikesh/Library/Preferences/truffle-nodejs/config.json.tmp-4644209492910867'
    at openSync (node:fs:601:3)
    at attempt (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/atomically/dist/utils/retryify.js:33:1)
    at Object.writeFileSync (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/atomically/dist/index.js:136:1)
    at Conf._write (/usr/local/lib/node_modules/truffle/build/webpack:/packages/config/node_modules/conf/dist/source/index.js:375:1)
    at Conf.set store [as store] (/usr/local/lib/node_modules/truffle/build/webpack:/packages/config/node_modules/conf/dist/source/index.js:296:1)
    at Conf.set (/usr/local/lib/node_modules/truffle/build/webpack:/packages/config/node_modules/conf/dist/source/index.js:189:1)
    at /usr/local/lib/node_modules/truffle/build/webpack:/packages/dashboard/dist/lib/DashboardServer.js:76:1
    at Layer.handle [as handle_request] (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/express/lib/router/layer.js:95:1)
    at next (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/express/lib/router/route.js:137:1)
    at Route.dispatch (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/express/lib/router/route.js:112:1)
    at Layer.handle [as handle_request] (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/express/lib/router/layer.js:95:1)
    at /usr/local/lib/node_modules/truffle/build/webpack:/node_modules/express/lib/router/index.js:281:1
    at Function.process_params (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/express/lib/router/index.js:341:1)
    at next (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/express/lib/router/index.js:275:1)
    at /usr/local/lib/node_modules/truffle/build/webpack:/node_modules/express/node_modules/body-parser/lib/read.js:130:1
    at invokeCallback (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/express/node_modules/raw-body/index.js:224:1)
    at done (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/express/node_modules/raw-body/index.js:213:1)
    at IncomingMessage.onEnd (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/express/node_modules/raw-body/index.js:273:1)
    at IncomingMessage.emit (node:events:513:28)
    at endReadableNT (node:internal/streams/readable:1359:12)
    at processTicksAndRejections (node:internal/process/task_queues:82:21)

这是我第一次使用truffle,当我运行命令truffle dashboard时,我得到了这个错误。这是我文件link

nkkqxpd9

nkkqxpd91#

我在truffle上遇到了这个问题。我知道这可能有点鲁莽,但我的解决方案是将.config目录中所有文件的所有权更改为我的用户。为了实现这一点,我做了以下工作:
sudo chown myUsername:myUsername -R ~/.config
如果你想更小心一点,你可以选择运行
sudo chown myUsername:myUsername ~/.config
sudo chown myUsername:myUsername ~/.config/truffle
sudo chown myUsername:myUsername ~/.config/truffle/config.json
在完成这些之后,我可以运行sudo npm i -g truffle。这是一个快速修复所有的问题,我以前,我希望它为你工作!
或者一旦在我以前的设置,类似的问题发生修复它与
npm i -g --unsafe-perm=true --allow-root truffle

相关问题