为博览会应用程序运行npm start时出错,我认为是由于sudo造成的

问题描述 投票:0回答:1

我正在尝试运行我的应用程序,但是我只能在使用“ sudo npm start”时运行它,我认为这会影响expo中我的应用程序的构建。我相信当我能够运行“ npm start”时,我的问题将会消失,但是到目前为止,当我运行此命令时,出现以下错误:

> @ start /Users/ryanfay/csc308outdoors
> expo start

Uncaught Error [Error: EACCES: permission denied, open '/Users/ryanfay/.expo/state.json.725563943'] {
  errno: -13,
  code: 'EACCES',
  syscall: 'open',
  path: '/Users/ryanfay/.expo/state.json.725563943'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ start: `expo start`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/ryanfay/.npm/_logs/2020-05-20T02_01_41_168Z-debug.log
node.js npm expo sudo
1个回答
1
投票

应用正在尝试使用的文件可能属于另一个用户。如果您在某个时候运行了sudo npm start,则可能会发生,那么创建的任何文件都将属于root用户。

您可以使用sudo chown -R ryanfay /Users/ryanfay/.expo将所有权更改回您的用户。

© www.soinside.com 2019 - 2024. All rights reserved.