Haste 模块映射中不存在模块“expo”
Module `expo` does not exist in the Haste module map
我正在尝试创建一个 react-native 包并收到以下错误:
Unable to resolve module `expo` from `C:\Users\<User>\Projects\myProject\src\HomeScreen\HomeScreen.js`: Module `expo` does not exist in the Haste module map
This might be related to https://github.com/facebook/react-native/issues/4968
To resolve try the following:
1. Clear watchman watches: `watchman watch-del-all`.
2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.
3. Reset Metro Bundler cache: `rm -rf /tmp/metro-bundler-cache-*` or `npm star
t -- --reset-cache`. 4. Remove haste cache: `rm -rf /tmp/haste-map-react-native
-packager-*`.
关于如何安装 expo 模块的任何线索。尝试执行 npm --proxy=http_proxy_server:proxy_port install --save expo
但失败并出现以下错误:
npm ERR! fetch failed https://github.com/expo/react-native-maps/archive/0.20.1-e
xp.0.tar.gz
npm WARN retry will retry, error on last attempt: Error: tunneling socket could
not be established, statusCode=400
npm ERR! fetch failed https://github.com/expo/node-websql/archive/18.0.0.tar.gz
npm WARN retry will retry, error on last attempt: Error: tunneling socket could
not be established, statusCode=400
npm ERR! fetch failed https://github.com/expo/react-native-maps/archive/0.20.1-e
xp.0.tar.gz
npm WARN retry will retry, error on last attempt: Error: tunneling socket could
not be established, statusCode=400
npm ERR! fetch failed https://github.com/expo/node-websql/archive/18.0.0.tar.gz
npm WARN retry will retry, error on last attempt: Error: tunneling socket could
not be established, statusCode=400
npm ERR! fetch failed https://github.com/expo/react-native-maps/archive/0.20.1-e
xp.0.tar.gz
npm ERR! fetch failed https://github.com/expo/node-websql/archive/18.0.0.tar.gz
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\
node_modules\npm\bin\npm-cli.js" "install" "--save" "expo"
npm ERR! node v7.9.0
npm ERR! npm v4.2.0
npm ERR! code ECONNRESET
有什么建议吗?
上述问题是由于代理限制了对 github.com 的访问。我连接到非代理网络并从 .npmrc
清除了我的代理设置,还在终端上使用了以下说明:
npm config delete proxy -g
npm config delete http-proxy -g
npm config delete https-proxy -g
git config --global --unset core.gitproxy
对我的机器进行上述更改后,我 运行 以下命令成功了!
react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
我正在尝试创建一个 react-native 包并收到以下错误:
Unable to resolve module `expo` from `C:\Users\<User>\Projects\myProject\src\HomeScreen\HomeScreen.js`: Module `expo` does not exist in the Haste module map
This might be related to https://github.com/facebook/react-native/issues/4968
To resolve try the following:
1. Clear watchman watches: `watchman watch-del-all`.
2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.
3. Reset Metro Bundler cache: `rm -rf /tmp/metro-bundler-cache-*` or `npm star
t -- --reset-cache`. 4. Remove haste cache: `rm -rf /tmp/haste-map-react-native
-packager-*`.
关于如何安装 expo 模块的任何线索。尝试执行 npm --proxy=http_proxy_server:proxy_port install --save expo
但失败并出现以下错误:
npm ERR! fetch failed https://github.com/expo/react-native-maps/archive/0.20.1-e
xp.0.tar.gz
npm WARN retry will retry, error on last attempt: Error: tunneling socket could
not be established, statusCode=400
npm ERR! fetch failed https://github.com/expo/node-websql/archive/18.0.0.tar.gz
npm WARN retry will retry, error on last attempt: Error: tunneling socket could
not be established, statusCode=400
npm ERR! fetch failed https://github.com/expo/react-native-maps/archive/0.20.1-e
xp.0.tar.gz
npm WARN retry will retry, error on last attempt: Error: tunneling socket could
not be established, statusCode=400
npm ERR! fetch failed https://github.com/expo/node-websql/archive/18.0.0.tar.gz
npm WARN retry will retry, error on last attempt: Error: tunneling socket could
not be established, statusCode=400
npm ERR! fetch failed https://github.com/expo/react-native-maps/archive/0.20.1-e
xp.0.tar.gz
npm ERR! fetch failed https://github.com/expo/node-websql/archive/18.0.0.tar.gz
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\
node_modules\npm\bin\npm-cli.js" "install" "--save" "expo"
npm ERR! node v7.9.0
npm ERR! npm v4.2.0
npm ERR! code ECONNRESET
有什么建议吗?
上述问题是由于代理限制了对 github.com 的访问。我连接到非代理网络并从 .npmrc
清除了我的代理设置,还在终端上使用了以下说明:
npm config delete proxy -g
npm config delete http-proxy -g
npm config delete https-proxy -g
git config --global --unset core.gitproxy
对我的机器进行上述更改后,我 运行 以下命令成功了!
react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res