Cannot find module 'minizlib'

2020-04-17 06:32发布

问题:

I am pretty new to React-Native. I install react-native on my Mac using the code below:

npm install react-native -g react-native-cli

I got the error:

npm ERR! code MODULE_NOT_FOUND
npm Err! Cannot find module 'minizlib'

Anyone can help me to solve this problem please?

回答1:

I had the same problem

npm i minizlib --global

This helped me



回答2:

New to this myself as a disclaimer but you may want to try uninstalling node.

If you installed node with Homebrew try...

$ brew uninstall node $ brew install node



回答3:

Try this

brew install node
brew install watchman
npm install -g react-native-cli
react-native init AwesomeProject

Follow the exact steps in https://facebook.github.io/react-native/docs/getting-started.html in the Building Projects with Native Code tab.