ERROR in ./src/main.js
Module build failed (from ./node_modules/_babel-loader@7.1.5@babel-loader/lib/index.js):
Error: Couldn't find preset "stage-2" relative to directory "D:\\vuelearn\\VueLearn\\03-前端模块化\\LearnVuejs04-v2\\01-
webpack的使用\\03-webpack的loader
解决方案:
---安装babel-preset-stage-2----
cnpm install --save-dev babel-preset-stage-2
ebpack 5.17.0 compiled with 1 error and 1 warning in 2668 ms
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! metpkg@1.0.0 build: `webpack`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the metpkg@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! D:\Program Files\nodejs\node_cache\_logs\2021-01-27T01_21_37_016Z-debug.log
PS D:\vuelearn\VueLearn\03-前端模块化\LearnVuejs04-v2\01-webpack的使用\03-webpack的loader> cnpm install --save-dev babel-preset-stage-2
√ Installed 1 packages
√ Linked 21 latest versions
√ Run 0 scripts
√ All packages installed (13 packages installed from npm registry, used 537ms(network 509ms), speed 150.31kB/s, json 22
(76.51kB), tarball 0B)
PS D:\vuelearn\VueLearn\03-前端模块化\LearnVuejs04-v2\01-webpack的使用\03-webpack的loader>