Error: Cannot find module 'commander'
程序员文章站
2022-03-03 19:21:01
...
1、错误描述
C:\Users\Administrator.USER-0GUONPPBHK>vue list
internal/modules/cjs/loader.js:596
throw err;
^
Error: Cannot find module 'commander'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:594:15)
at Function.Module._load (internal/modules/cjs/loader.js:520:25)
at Module.require (internal/modules/cjs/loader.js:650:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (D:\nodejs\node_modules\vue-cli\bin\vue:3:17)
at Module._compile (internal/modules/cjs/loader.js:702:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10)
at Module.load (internal/modules/cjs/loader.js:612:32)
at tryModuleLoad (internal/modules/cjs/loader.js:551:12)
at Function.Module._load (internal/modules/cjs/loader.js:543:3)
C:\Users\Administrator.USER-0GUONPPBHK>
2、错误原因
使用vue list查看所有的可用的官方模板,出现找不到模块commander
3、解决办法
(1)直接执行安装commander模块命令
cnpm install commander --save
(2)全局安装vue-cli
npm i vue-cli -g
推荐阅读
-
编译PHP报错configure error Cannot find libmysqlclient under usr的解决方法
-
webpack-dev-server config.js Cannot find module
-
cannot find supercluster & native module cannot be null & Xcode build timeout
-
Error: ENOENT: no such file or directory, uv_cwd Error: Cannot find module
-
【已解决】运行webpack-dev-server时提示Error: Cannot find module ‘webpack-cli/bin/config-yargs‘
-
An unhandled exception occurred: Cannot find module '@angular-devkit/build-angular/package.json'
-
webpack5: Error: Cannot find module ‘webpack-cli/bin/config-yargs‘
-
Webpack 报错:Error: Cannot find module ‘webpack-cli/bin/config-yargs‘
-
webpack-dev-server 报错 Error: Cannot find module ‘webpack/bin/config-yargs‘
-
webpack——Error: Cannot find module ‘webpack-cli/bin/config-yargs‘