dva搭建项目 使用命令行创建路由报错

https://github.com/sorrycc/bl... 例子搭建dva项目的时候
命令 $ dva g route users报错

create routeComponent src/routes/Users.js, src/routes/Users.css

TypeError: root.findRouters(...).getRouterInfo is not a function


at transform (C:\Users\nenawan\AppData\Roaming\npm\node_modules\dva-cli\node_modules\dva-ast\lib\transform.js:42:32)

at exports.default (C:\Users\nenawan\AppData\Roaming\npm\node_modules\dva-cli\node_modules\dva-ast\lib\api\index.js:46:36)

at C:\Users\nenawan\AppData\Roaming\npm\node_modules\dva-cli\lib\generate.js:92:27

at generate (C:\Users\nenawan\AppData\Roaming\npm\node_modules\dva-cli\lib\generate.js:108:11)

at Object.<anonymous> (C:\Users\nenawan\AppData\Roaming\npm\node_modules\dva-cli\bin\dva-generate:11:27)

at Module._compile (module.js:570:32)

at Object.Module._extensions..js (module.js:579:10)

at Module.load (module.js:487:32)

at tryModuleLoad (module.js:446:12)

at Function.Module._load (module.js:438:3)


慕虎7371278
浏览 996回答 1
1回答

元芳怎么了

类似的, dva g各种东西失败, 提示这个:dva g model usersssss/usr/local/lib/node_modules/dva-cli/bin/dva-generatemodule.js:471throw err;^Error: Cannot find module 'babel-runtime/helpers/slicedToArray'at Function.Module._resolveFilename (module.js:469:15)at Function.Module._load (module.js:417:25)at Module.require (module.js:497:17)at require (internal/module.js:20:19)at Object.<anonymous> (/usr/local/lib/node_modules/dva-cli/lib/generate.js:7:23)at Module._compile (module.js:570:32)at Object.Module._extensions..js (module.js:579:10)at Module.load (module.js:487:32)at tryModuleLoad (module.js:446:12)at Function.Module._load (module.js:438:3)各个版本:cnpm@5.1.1 (/usr/local/lib/node_modules/cnpm/lib/parse_argv.js)npm@5.3.0 (/usr/local/lib/node_modules/cnpm/node_modules/npm/lib/npm.js)node@6.11.2 (/usr/local/bin/node)dva-cli: 0.7.10node_modules删除过 重新npm i也不行.
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript