React-native start ERROR Packager can't listen on port 8081
2017-02-15 11:16
1311 查看
React-native start ERROR Packager can’t listen on port 8081 (本人第一篇博客)
ERROR Packager can’t listen on port 8081Most likely another process is already using this port
Run the following command to find out which process:
lsof -n -i4TCP:8081
You can either shut down the other process:
kill -9
or run packager on different port.
See http://facebook.github.io/react-native/docs/troubleshooting.html
for common problems and solutions.
解决:
打开工程目录, 找到local-cli\server/server.js
\项目路径\node_modules\react-native\local-cli\server
module.exports = { name: 'start', func: server, description: 'starts the webserver', options: [{ command: '--port [number]', default: 8081, parse: (val) => Number(val), }, { command: '--host [string]', default: '', }, { command: '--root [list]', description: 'add another root(s) to be used by the packager in this project', parse: (val) => val.split(',').map(root => path.resolve(root)), default: [], }, { command: '--projectRoots [list]', description: 'override the root(s) to be used by the packager', parse: (val) => val.split(','), default: (config) => config.getProjectRoots(), }, { command: '--assetExts [list]', description: 'Specify any additional asset extentions to be used by the packager', parse: (val) => val.split(','), default: (config) => config.getAssetExts(), }, { command: '--platforms [list]', description: 'Specify any additional platforms to be used by the packager', parse: (val) => val.split(','), default: (config) => config.getPlatforms(), }, { command: '--skipflow', description: 'Disable flow checks' }, { command: '--nonPersistent', description: 'Disable file watcher' }, { command: '--transformer [string]', description: 'Specify a custom transformer to be used' }, { command: '--reset-cache, --resetCache', description: 'Removes cached files', }, { command: '--verbose', description: 'Enables logging', }], };
修改
将”8081”修改成你想要的端口号, 我这里修改成”8888”
相关文章推荐
- React native Packager can't listen on port 8081
- react flux的坑之(四) 真机调试 Packager can't listen on port 8081
- ArcGIS Server启动服务报:ERROR: Unable to start Xvfb on any port in the range 6600 - 6619
- 【原】react-native start EACCESS error for setup_env.sh
- ASP.NET development server failed to start listening on port (dynamic port) & Error Unable to connect to Visual Stutio's localhost web server
- react-native 启动服务器时候报错Could not install the app on the device, read the error above for details.
- mysqld启动“ Can't start server: Bind on TCP/IP port: Address already in use Do you already have anothe
- React-Native首次运行提示-ReferenceError-Can-t-find-variable-fbBatchedBridge
- 关于mysql报错:Can't start server: Bind on TCP/IP port: Permission denied
- Unable to start gdbserver on port '63411' Can't open socket: Permission denied.的解决办法
- 20080331 - How many processes can listen on a single TCPIP port
- ArcGIS Server启动服务报:ERROR: Unable to start Xvfb on any port in the range 6600 - 6619
- MacOS Sierra下运行react-native start出现Error watching file for changes: EMFILE问题解决
- react-native初始化项目时候报错?Error: Command failed: yarn add react-native --exact
- mysql 解决 ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)
- react native Exception in thread "main" java.util.zip.ZipException: error in opening zip file
- unable to start debugging on the web server. An authentication error occurred while communicating with the web server.
- error:Can't load AMD 64-bit .dll on a IA 32-bit platform
- SQLyog连接问题:SQL Error (2003): Can't connect to MySQL server on '46.x.x.x' (10061)
- aws linux服务器,ubuntu,远程连接MySQL,ERROR 2003 (HY000): Can't connect to MySQL server on