首页 新闻 搜索 专区 学院

dva生成路由报错

0
悬赏园豆:5 [已解决问题] 解决于 2017-12-29 15:53

dva生成路由报错,component should be one of Router, Route, Redirect, IndexRedirect, IndexRout

λ dva g route users                                                                                                          
E:\My-Resources\WEB\node-v8.9.3-win-x64\node-global\node_modules\dva-cli\bin\dva-generate                                    
      create  routeComponent src/routes/Users.js, src/routes/Users.css                                                       
      create  route users with src/routes/Users.js                                                                           
AssertionError [ERR_ASSERTION]: getRouterTree: component should be one of Router, Route, Redirect, IndexRedirect, IndexRout  
e                                                                                                                            
    at parse (E:\My-Resources\WEB\node-v8.9.3-win-x64\node-global\node_modules\dva-cli\node_modules\dva-ast\lib\collections  
\Router.js:57:28)                                                                                                            
    at ret.children.node.children.filter.map.node (E:\My-Resources\WEB\node-v8.9.3-win-x64\node-global\node_modules\dva-cli  
\node_modules\dva-ast\lib\collections\Router.js:94:93)                                                                       
    at Array.map (<anonymous>)                                                                                               
    at parse (E:\My-Resources\WEB\node-v8.9.3-win-x64\node-global\node_modules\dva-cli\node_modules\dva-ast\lib\collections  
\Router.js:94:81)                                                                                                            
    at NodePath.simpleMap.path (E:\My-Resources\WEB\node-v8.9.3-win-x64\node-global\node_modules\dva-cli\node_modules\dva-a  
st\lib\collections\Router.js:117:13)                                                                                         
    at NodePath.<anonymous> (E:\My-Resources\WEB\node-v8.9.3-win-x64\node-global\node_modules\dva-cli\node_modules\dva-ast\  
lib\collections\Helper.js:21:28)                                                                                             
    at __paths.forEach (E:\My-Resources\WEB\node-v8.9.3-win-x64\node-global\node_modules\dva-cli\node_modules\jscodeshift\s  
rc\Collection.js:76:36)                                                                                                      
    at Array.forEach (<anonymous>)                                                                                           
    at Collection.forEach (E:\My-Resources\WEB\node-v8.9.3-win-x64\node-global\node_modules\dva-cli\node_modules\jscodeshif  
t\src\Collection.js:75:18)                                                                                                   
    at Collection.simpleMap (E:\My-Resources\WEB\node-v8.9.3-win-x64\node-global\node_modules\dva-cli\node_modules\dva-ast\  
lib\collections\Helper.js:20:10)                                                                                  
View Code
那朵云像只狗的主页 那朵云像只狗 | 初学一级 | 园豆:7
提问于:2017-12-27 21:20
< >
分享
最佳答案
0
收获园豆:5
dudu | 高人七级 |园豆:36412 | 2017-12-27 21:59
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册