跟随read.me at https://github.com/react-community/create-react-native-app
使用expo init命令选择模板后,得到以下错误
Cannot find module 'minizlib'
Error: Cannot find module 'minizlib'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (/usr/local/lib/node_modules/expo-cli/node_modules/pacote/node_modules/tar/lib/pack.js:28:14)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (/usr/local/lib/node_modules/expo-cli/node_modules/pacote/node_modules/tar/lib/create.js:6:14)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)我已经尝试过这些线程上的所有内容:
Expo commands throwing "Error: Cannot find module 'minizlib'"
所以我已经卸载/安装了Nodejs,尝试用brew安装它,并且尝试安装minizlib,它不会改变任何东西。
Nodejs版本: v10.16.3
操作系统: Pop!_OS 18.04 LTS
如果有人能帮忙的话,谢谢
发布于 2019-09-09 19:54:26
最后,我尝试处理nvm,并测试每个节点版本,以确定它是否有效。
nvm install <number of node version>
npm install -g expo-cli它最终适用于nvm install 10,(但我仍然不知道我为什么要这么做,因为我已经有了nodeJs 10)
发布于 2019-10-08 16:15:17
"minizlib“没有被找到,我也有同样的问题。这里发布的任何解决方案或其他有关这个问题的线程都没有解决这个问题。
我想出了解决方案,并把它发布在最近关于这个问题的帖子上。
https://stackoverflow.com/questions/57860218
复制相似问题