目 录CONTENT

文章目录

vue报错: ERROR Error Cannot find module 'vue-template-compiler package.json'

大T
2021-11-28 / 0 评论 / 0 点赞 / 177 阅读 / 0 字

vue报错: ERROR Error: Cannot find module 'vue-template-compiler/package.json'

vue报错: ERROR  Error  Cannot find module 'vue-template-compiler package.json'

1、报错描述

ERROR Error: Cannot find module 'vue-template-compiler/package.json'

INFO  Starting development server...
 ERROR  Error: Cannot find module 'vue-template-compiler/package.json'
Require stack:
- C:\Users\Administrator\AppData\Roaming\npm\node_modules\@vue\cli-service\lib\config\base.js
- C:\Users\Administrator\AppData\Roaming\npm\node_modules\@vue\cli-service\lib\Service.js
- C:\Users\Administrator\AppData\Roaming\npm\node_modules\@vue\cli-service\bin\vue-cli-service.js
Error: Cannot find module 'vue-template-compiler/package.json'
Require stack:
- C:\Users\Administrator\AppData\Roaming\npm\node_modules\@vue\cli-service\lib\config\base.js
- C:\Users\Administrator\AppData\Roaming\npm\node_modules\@vue\cli-service\lib\Service.js
- C:\Users\Administrator\AppData\Roaming\npm\node_modules\@vue\cli-service\bin\vue-cli-service.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at C:\Users\Administrator\AppData\Roaming\npm\node_modules\@vue\cli-service\lib\config\base.js:89:34
    at C:\Users\Administrator\AppData\Roaming\npm\node_modules\@vue\cli-service\lib\Service.js:236:40
    at Array.forEach (<anonymous>)
    at Service.resolveChainableWebpackConfig (C:\Users\Administrator\AppData\Roaming\npm\node_modules\@vue\cli-service\lib\Service.js:236:26)
    at Service.resolveWebpackConfig (C:\Users\Administrator\AppData\Roaming\npm\node_modules\@vue\cli-service\lib\Service.js:240:48)
    at PluginAPI.resolveWebpackConfig (C:\Users\Administrator\AppData\Roaming\npm\node_modules\@vue\cli-service\lib\PluginAPI.js:132:25)

2、问题原因

少按照了vue-template-compiler模块

3、解决方案

执行以下命令安装:

npm install vue-template-compiler -g

0

评论区