首页 > 解决方案 > 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.log

35648 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 ]

标签: react-nativenpmvue-native

解决方案


我在使用 npm install -g expo-cli 时遇到了同样的问题,有“MODULE_NOT_FOUND”,

我用 brew 安装了 yarm,以防万一你还没有它:

brew install yarn

然后使用:

yarn global add expo-cli

要创建一个项目,您可以:

expo init nameOfTheNewProject

并在控制台中选择一个模板。最后运行项目

yarn start

请让我知道这对你有没有用!


推荐阅读