react-redux-starter-kit 项目启动报错

 报错信息:  

D:\workspace\AAA                                                                                        
λ  npm start                                                                                            

> react-redux-starter-kit@3.0.1 start D:\workspace\AAA                                                  
> cross-env NODE_ENV=development node build/scripts/start                                               

i Starting server...                                                                                    
i Enabling webpack development and HMR middleware                                                       
events.js:182                                                                                           
      throw er; // Unhandled 'error' event                                                              
      ^                                                                                                 

Error: listen EADDRINUSE :::3000                                                                        
    at Object._errnoException (util.js:1021:11)                                                         
    at _exceptionWithHostPort (util.js:1043:20)                                                         
    at Server.setupListenHandle [as _listen2] (net.js:1344:14)                                          
    at listenInCluster (net.js:1385:12)                                                                 
    at Server.listen (net.js:1469:7)                                                                    
    at Function.listen (D:\workspace\AAA\node_modules\express\lib\application.js:618:24)                
    at Object.<anonymous> (D:\workspace\AAA\build\scripts\start.js:5:30)                                
    at Module._compile (module.js:624:30)                                                               
    at Object.Module._extensions..js (module.js:635:10)                                                 
    at Module.load (module.js:545:32)                                                                   
    at tryModuleLoad (module.js:508:12)                                                                 
    at Function.Module._load (module.js:500:3)                                                          
    at Function.Module.runMain (module.js:665:10)                                                       
    at startup (bootstrap_node.js:187:16)                                                               
    at bootstrap_node.js:608:3                                                                          
npm ERR! code ELIFECYCLE                                                                                
npm ERR! errno 1                                                                                        
npm ERR! react-redux-starter-kit@3.0.1 start: `cross-env NODE_ENV=development node build/scripts/start` 
npm ERR! Exit status 1                                                                                  
npm ERR!                                                                                                
npm ERR! Failed at the react-redux-starter-kit@3.0.1 start script.                                      
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.      

npm ERR! A complete log of this run can be found in:                                                    
npm ERR!     C:\Users\shwh\AppData\Roaming\npm-cache\_logs\2017-10-18T02_38_11_981Z-debug.log           

由于近几日几个项目来回切换,本地使用nvm for Windows做了版本管理,
当我再次切换为node最新版时,又爆了这个眼熟的错误,于是,我优先的查看了下端口号是否被占用,果然,端口被占用了。

老套路解决

D:\workspace\AAA
λ  netstat -aon|findstr :3000
  TCP    0.0.0.0:3000           0.0.0.0:0              LISTENING       3080
  TCP    [::]:3000              [::]:0                 LISTENING       3080
D:\workspace\AAA
λ  tasklist /fi "pid eq 3080"

映像名称                       PID 会话名              会话#       内存使用
========================= ======== ================ =========== ============
node.exe                      3080 Console                    2     13,968 K
D:\workspace\AAA
λ  tasklist /fi "pid eq 3080"

映像名称                       PID 会话名              会话#       内存使用
========================= ======== ================ =========== ============
node.exe                      3080 Console                    2     13,968 K
D:\workspace\AAA
λ  kill 3080
D:\workspace\AAA
λ  tasklist /fi "pid eq 3080"
信息: 没有运行的任务匹配指定标准。  

再次npm start,成功启动。

发布者

iamorz

前端技术群:263240563

发表评论