Здравствуйте. Я только сегодня сел учить webpack и получил эту ошибку: Error: Cannot find module '@babel/preset-env'
Перелазил все форумы, но ничего не помогло.
Вот код babel:
{
presets: [
"@babel/preset-env",
"stage-3"
]
}
Вот код webpack config:
let path = require('path');
let conf = {
entry: './src/index.js',
output: {
path: path.resolve(__dirname, './dist'),
filename: 'main.js',
publicPath: 'dist/'
},
devServer: {
overlay: true
},
module: {
rules : [
{
test: /\.js$/,
loader: 'babel-loader'
}
]
}
}
module.exports = conf;
Вот package.json:
{
"name": "webpack-sandbox.ru",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"dev": "webpack-dev-server --mode development --open",
"build": "webpack --mode production"
},
"author": "",
"license": "ISC",
"devDependencies": {
"babel-core": "^6.26.3",
"babel-loader": "^8.0.5",
"babel-preset-env": "^1.7.0",
"babel-preset-stage-3": "^6.24.1",
"babel-upgrade": "^1.0.1",
"path": "^0.12.7",
"webpack": "^4.29.6",
"webpack-cli": "^3.3.0",
"webpack-dev-server": "^3.3.1"
},
"dependencies": {
"@babel/core": "^7.4.3"
}
}
Заранее спасибо за помощь.