Tôi nhận được lỗi sau khi cố gắng sử dụng babel.Lỗi: Không thể tìm thấy giá trị đặt trước "es2015" tương ứng với thư mục
Error: Couldn't find preset "es2015" relative to directory
webpack.config.js
module.exports = {
entry: './main.js',
ourput: {
path:'./',
filename:'index.js'
},
devServer:{
inline:true,
port:3333
},
module:{
loaders:[
{
test:/\.js$/,
exclude:/node_modules/,
loader:'babel',
query:{
presets:['es2015','react']
}
}
]
}
}
package.json
{
"name": "es6-react-setup",
"version": "1.0.0",
"main": "main.js",
"dependencies": {
"babel-core": "^6.11.4",
"babel-preset-es2015": "^6.9.0",
"babel-preset-react": "^6.11.1",
"babel-loader": "^6.2.4",
"react": "^15.2.1",
"react-dom": "^15.2.1",
"webpack": "^1.13.1"
},
"devDependencies": {},
"scripts": {
"start": "webpack-dev-server"
},
"author": "",
"license": "ISC",
"description": ""
}
ga đầu ra
Bản sao có thể có của [Lỗi: Không thể tìm thấy giá trị đặt trước "es2015" liên quan đến thư mục "/Users/username"](http://stackoverflow.com/questions/34819473/error-couldnt-find-preset-es2015- tên người dùng tương đối-người dùng-thư mục-người dùng) –