React Native module.js throw err


在运行 react-native提供的example的时候遇到这个错误。

~/react-native/packager ~
module.js:440
throw err;
^
Error: Cannot find module 'core-js/fn/array/values'
at Function.Module._resolveFilename (module.js:438:15)
at Function.Module._load (module.js:386:25)
at Module.require (module.js:466:17)
at require (internal/module.js:20:19)
at Object. (/Users/luke/react-native/packager/babelRegisterOnly.js:11:27)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:456:32)
at tryModuleLoad (module.js:415:12)
at Function.Module._load (module.js:407:3)
~
Process terminated. Press to close the window

这个错误产生的原因是example找不到node_modules. 可以看下react-native 目录下面是否有node_modules. 解决办法是跑到react active 目录下执行 npm install.

$ cd react-native & npm install

你可能感兴趣的:(React Native module.js throw err)