了解来自Meteor.js的错误消息:错误:EACCES,权限被拒绝

Cur*_*arn 2 meteor meteorite

我的meteor.js应用程序崩溃了.我收到以下错误.看来该错误不在我的应用程序代码中.如果有人可以查看以下消息并让我知道如何摆脱这个错误,我将不胜感激.

错误信息

Your application is crashing. Waiting for file change.
=> Modified -- restarting.
=> Errors prevented startup:
Exception while bundling application:
Error: EACCES, permission denied '/Users/username/Dropbox/LearnSoftware_and_Math/LearnJavascript/LearnMeteor/microscope/.meteor/local/build/app/collections/posts.js'
    at Object.fs.unlinkSync (fs.js:582:18)
    at Object._.extend.rm_recursive (/Users/username/.meteor/tools/275efdf2db/tools/files.js:278:10)
    at _.extend.rm_recursive (/Users/username/.meteor/tools/275efdf2db/tools/files.js:274:15)
    at Array.forEach (native)
    at Function._.each._.forEach (/Users/username/.meteor/tools/275efdf2db/lib/node_modules/underscore/underscore.js:79:11)
    at Object._.extend.rm_recursive (/Users/username/.meteor/tools/275efdf2db/tools/files.js:272:9)
    at _.extend.rm_recursive (/Users/username/.meteor/tools/275efdf2db/tools/files.js:274:15)
    at Array.forEach (native)
    at Function._.each._.forEach (/Users/username/.meteor/tools/275efdf2db/lib/node_modules/underscore/underscore.js:79:11)
    at Object._.extend.rm_recursive (/Users/username/.meteor/tools/275efdf2db/tools/files.js:272:9)
    at _.extend.rm_recursive (/Users/username/.meteor/tools/275efdf2db/tools/files.js:274:15)
    at Array.forEach (native)
    at Function._.each._.forEach (/Users/username/.meteor/tools/275efdf2db/lib/node_modules/underscore/underscore.js:79:11)
    at Object._.extend.rm_recursive (/Users/username/.meteor/tools/275efdf2db/tools/files.js:272:9)
    at _.extend.write_to_directory (/Users/username/.meteor/tools/275efdf2db/tools/bundler.js:794:11)
    at Object.exports.bundle (/Users/username/.meteor/tools/275efdf2db/tools/bundler.js:873:12)
    at /Users/username/.meteor/tools/275efdf2db/tools/run.js:694:26
    at exports.inFiber (/Users/username/.meteor/tools/275efdf2db/tools/fiber-helpers.js:24:12)
=> Your application is crashing. Waiting for file change.
Run Code Online (Sandbox Code Playgroud)

Cur*_*arn 5

我在该主题上进行了更多搜索,似乎是使用sudo安装一些meteorite需要的软件包时出现的问题。正如此 Github 问题页面上所建议的,解决此问题的一种方法是删除/.meteor/local/build应用程序中的文件夹并重新启动 Meteor。


sko*_*ozz 5

这对我/.meteor/local/build有用:重新设置(以避免使用sudo)对用户的chown权限.

例如,我的用户是"skozz".在我的项目文件夹中:

sudo chown -R skozz .meteor/local/build

然后跑mrtmeteor

如果问题仍然存在,您可能应该为主.npm文件夹设置相同的权限.就我而言:

chown -R skozz ~/.npm
Run Code Online (Sandbox Code Playgroud)