yarn run serve error Error: Cannot find module '@vue/cli-plugin-babel' solution

problem overview

Regarding this problem, I encountered it when building the front-end project. After the project was built, when "yarn run serve" started the project, the problem occurred: "Error: Cannot find  module '@vue/cli-plugin-babel'  "

As shown below:

Specific information is as follows:

yarn run v1.22.19
$ vue-cli-service serve
internal/modules/cjs/loader.js:905
  throw err;
  ^

Error: Cannot find module '@vue/cli-plugin-babel'
Require stack:
- C:\Users\Jackson\AppData\Roaming\npm\node_modules\@vue\cli-service\lib\Service.js        
- C:\Users\Jackson\AppData\Roaming\npm\node_modules\@vue\cli-service\bin\vue-cli-service.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at idToPlugin (C:\Users\Jackson\AppData\Roaming\npm\node_modules\@vue\cli-service\lib\Service.js:172:14)
    at C:\Users\Jackson\AppData\Roaming\npm\node_modules\@vue\cli-service\lib\Service.js:211:20
    at Array.map (<anonymous>)
    at Service.resolvePlugins (C:\Users\Jackson\AppData\Roaming\npm\node_modules\@vue\cli-service\lib\Service.js:198:10)
    at new Service (C:\Users\Jackson\AppData\Roaming\npm\node_modules\@vue\cli-service\lib\Service.js:35:25)
    at Object.<anonymous> (C:\Users\Jackson\AppData\Roaming\npm\node_modules\@vue\cli-service\bin\vue-cli-service.js:15:17) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\Users\\Jackson\\AppData\\Roaming\\npm\\node_modules\\@vue\\cli-service\\lib\\Service.js',
    'C:\\Users\\Jackson\\AppData\\Roaming\\npm\\node_modules\\@vue\\cli-service\\bin\\vue-cli-service.js'
  ]
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Solution 

According to the error message, the component "@vue/cli-plugin-babel" was not found in the local environment,

Just install it locally, enter the command: npm install -g @vue/[email protected] 

After the components are installed, the project can be started successfully! ! !


Well, the solution to the error Error: Cannot find module '@vue/cli-plugin-babel' about yarn run serve is written here. If you have any questions or encounter any problems, please scan the QR code to ask questions, and you can also give I leave a message, and I will answer them in detail one by one. 
Xiehouyu: "Learning together, making progress together", I also hope that everyone will pay more attention to the IT community of CSND.


author: Andy
Contact the author: [email protected]
Source: CSDN (Chinese Software Developer Network)
Original text: https://blog.csdn.net/Hello_World_QWP/article/details/127006367
Copyright Notice: This article is the blogger's original article, please be sure to indicate the source of the blog post when reprinting!

Guess you like

Origin blog.csdn.net/Hello_World_QWP/article/details/127006367