react-native - I can't install expo-cli
问题描述
When I install expo-cli
with npm i -g expo-cli
I get thousands of npm WARN tar invalid entry
, and then I get this error :
npm ERR! path C:\Users\mrkinix\AppData\Roaming\npm\node_modules\expo-cli\node_modules@expo\bunyan\bin\bunyan npm ERR! code ENOENT npm ERR! errno -4058 npm ERR! syscall chmod npm ERR! enoent ENOENT: no such file or directory, chmod 'C:\Users\mrkinix\AppData\Roaming\npm\node_modules\expo-cli\node_modules@expo\bunyan\bin\bunyan' npm ERR! enoent This is related to npm not being able to find a file. npm ERR! enoent
npm ERR! A complete log of this run can be found in: npm ERR!
C:\Users\mrkinix\AppData\Roaming\npm-cache_logs\2018-12-15T14_11_31_669Z-debug.log35648 error path C:\Users\mrkinix\AppData\Roaming\npm\node_modules\expo-cli\node_modules@expo\dev-tools\node_modules\lodash 35649 error code ENOENT 35650 error errno -4058 35651 error syscall rename 35652 error enoent ENOENT: no such file or directory, rename 'C:\Users\mrkinix\AppData\Roaming\npm\node_modules\expo-cli\node_modules@expo\dev-tools\node_modules\lodash' -> 'C:\Users\mrkinix\AppData\Roaming\npm\node_modules\expo-cli\node_modules@expo\dev-tools\node_modules.lodash.DELETE' 35653 error enoent This is related to npm not being able to find a file. 35654 verbose exit [ -4058, true ]
解决方案
我在使用 npm install -g expo-cli 时遇到了同样的问题,有“MODULE_NOT_FOUND”,
我用 brew 安装了 yarm,以防万一你还没有它:
brew install yarn
然后使用:
yarn global add expo-cli
要创建一个项目,您可以:
expo init nameOfTheNewProject
并在控制台中选择一个模板。最后运行项目
yarn start
请让我知道这对你有没有用!
推荐阅读
- python - ModuleNotFoundError:没有使用 azure 函数 + Python + 私有存储库名为“x”的模块
- jquery - 检查画布 dpi
- anchor - 如何在这个平台做主播
- c++ - 对“function_name”的未定义引用:错误:ld 返回 1 个退出状态
- reactjs - RNFetchBlob 不适用于 Android 11 及更高版本的 React Native
- android - 更新 Android 的 PJSIP 版本,创建端点时导致断言错误
- youtube-api - Youtube API, PlaylistItems: list, maxResults - 工作不正常
- asp.net-core - gRPC ASP.NET Core:使用什么类型而不是对象?
- r - 替换数据框中的整个字符串
- laravel - Laravel sync() - 具有多个主键