node.js - react-native start 启动server报错

浏览:26日期:2022-09-24

问题描述

react-native run-android 启动本地服务时失败。报错如下

Last login: Thu Jan 12 21:44:07 on ttys000appledembp:IRunning apple$ react-native startScanning 1630 folders for symlinks in /Users/apple/Desktop/project/reactproject/IRunning/node_modules (24ms) ┌────────────────────────────────────────────────────────────────────────────┐ │ Running packager on port 8081. │ ││ │ Keep this packager running while developing on any JS projects. Feel │ │ free to close this tab and run your own packager instance if you │ │ prefer. │ ││ │ https://github.com/facebook/react-native │ ││ └────────────────────────────────────────────────────────────────────────────┘ Looking for JS files in /Users/apple/Desktop/project/reactproject/IRunning/node_modules/.0.33.0@react-nativeCannot read property ’on’ of undefinednpm ERR! Darwin 16.3.0npm ERR! argv '/usr/local/Cellar/node@5/5.12.0/bin/node' '/usr/local/bin/npm' 'start'npm ERR! node v5.12.0npm ERR! npm v3.8.6npm ERR! code ELIFECYCLEnpm ERR! 1@1.1.1 start: `node node_modules/react-native/local-cli/cli.js start`npm ERR! Exit status 1npm ERR! npm ERR! Failed at the 1@1.1.1 start script ’node node_modules/react-native/local-cli/cli.js start’.npm ERR! Make sure you have the latest version of node.js and npm installed.npm ERR! If you do, this is most likely a problem with the 1 package,npm ERR! not with npm itself.npm ERR! Tell the author that this fails on your system:npm ERR! node node_modules/react-native/local-cli/cli.js startnpm ERR! You can get information on how to open an issue for this project with:npm ERR! npm bugs 1npm ERR! Or if that isn’t available, you can get their info via:npm ERR! npm owner ls 1npm ERR! There is likely additional logging output above.npm ERR! Please include the following file with any support request:npm ERR! /Users/apple/Desktop/project/reactproject/IRunning/npm-debug.log

问题解答

回答1:

npm install ,重新下依赖!

相关文章: