问题描述
每当我尝试运行诸如expo init
或expo start
或什至只是expo
的命令时,它都会响应:
Whenever I try to run such commands as expo init
or expo start
or even just expo
, it responds with:
Error: Cannot find module 'minizlib'
Require stack:
- /usr/local/lib/node_modules/expo-cli/node_modules/tar/lib/pack.js
- /usr/local/lib/node_modules/expo-cli/node_modules/tar/lib/create.js
- /usr/local/lib/node_modules/expo-cli/node_modules/tar/index.js
- /usr/local/lib/node_modules/expo-cli/node_modules/@expo/xdl/build/Extract.js
- /usr/local/lib/node_modules/expo-cli/node_modules/@expo/xdl/build/Api.js
- /usr/local/lib/node_modules/expo-cli/node_modules/@expo/xdl/build/xdl.js
- /usr/local/lib/node_modules/expo-cli/build/exp.js
- /usr/local/lib/node_modules/expo-cli/bin/expo.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:625:15)
at Function.Module._load (internal/modules/cjs/loader.js:527:27)
at Module.require (internal/modules/cjs/loader.js:683:19)
at require (internal/modules/cjs/helpers.js:16:16)
at Object.<anonymous> (/usr/local/lib/node_modules/expo-cli/node_modules/tar/lib/pack.js:28:14)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:643:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
at Module.require (internal/modules/cjs/loader.js:683:19)
我尝试安装和重新安装minizlib,以及expo,expo-cli,npm和node,但没有任何效果.任何帮助将不胜感激.
I have tried install and reinstalling minizlib, along with expo, expo-cli, npm, and node and nothing has worked.Any help would be appreciated.
操作系统:Ubuntu 18.04.2
OS: Ubuntu 18.04.2
推荐答案
我遇到了同样的问题.我使用nvm install 10
降级到了节点的版本10(如果您没有NVM,请在此处非常有用),然后使用npm install -g expo-cli
重新安装expo-cli.最终为我解决了这个问题.
I had the same issue. I downgraded to version 10 of node using nvm install 10
(If you do not have NVM look into it here it is very useful) then reinstalled the expo-cli with npm install -g expo-cli
. This ended up solving the issue for me.
注意:如果您要将其降级为默认版本,则必须暂时运行nvm alias default 10
Note: This downgrade is temporary if you want to make it your default version you have to run nvm alias default 10
这篇关于Expo命令抛出“错误:找不到模块'minizlib'";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!