【发布时间】:2020-05-29 18:29:33
【问题描述】:
我想创建一个新的 react native 项目。起初,我在运行npm install -g expo-cli 时遇到了一个问题,我通过安装nvm 解决了这个问题,然后通过nvm 安装了node 和npm。当我运行expo init NewProject 时,我得到了这个错误。
请帮我解决一下好吗?
Uncaught Error [Error: EACCES: permission denied, open
'/home/pgf/.expo/state.json.1309825572'] {
errno: -13,
code: 'EACCES',
syscall: 'open',
path: '/home/pgf/.expo/state.json.1309825572'
}
我试过sudo expo init;我得到了这个✖ Something when wrong installing JavaScript dependencies. Check your npm logs. Continuing to initialize the app.,它创建了一个项目。当我使用expo start 运行项目时,我收到了这个错误
Uncaught Error [Error: EACCES: permission denied, open '/home/pgf/.expo/state.json.2684774492'] {
errno: -13,
code: 'EACCES',
syscall: 'open',
path: '/home/pgf/.expo/state.json.2684774492'
}
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 WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! /home/pgf/.npm/_logs/2020-05-29T19_37_07_602Z-debug.log
当我使用 sudo expo start 运行它时出现此错误
Cannot determine which native SDK version your project uses because the module `expo` is not installed. Please install it with `yarn add expo` and try again.
你能帮我解决这个问题吗?
【问题讨论】:
-
你试过用“sudo”运行它吗?例如“sudo expo init”
-
是的,我在帖子中添加了我得到的内容。 @ElliottWeeks
-
该错误表明您的节点模块不存在 try - npm install -- save 或 expo install 。然后重试运行expo start。确保你在项目目录中:) 祝你好运
标签: linux permissions expo linux-mint permission-denied