npm start时报错,提示如下
来源:2-7 模块化 - rollup安装
negrochn
2018-10-23
npm start报错
/* .babelrc */
{
"presets": [
["latest", {
"es2015": {
"modules": false
}
}]
],
"plugins": ["external-helpers"]
}
/* rollup.config.js */
import babel from 'rollup-plugin-babel'
import resolve from 'rollup-plugin-node-resolve'
export default {
entry: './src/index.js',
format: 'umd',
plugins: [
resolve(),
babel({
exclude: 'node_modules/**'
})
],
dest: './build/bundle.js'
}
/* package.json */
{
"name": "rollup-cj",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "rollup -c rollup.config.js"
},
"author": "",
"license": "ISC",
"devDependencies": {
"babel-core": "^6.26.3",
"babel-plugin-external-helpers": "^6.22.0",
"babel-preset-latest": "^6.24.1",
"rollup": "^0.66.6",
"rollup-plugin-babel": "^4.0.3",
"rollup-plugin-node-resolve": "^3.4.0"
}
}
写回答
3回答
-
negrochn
提问者
2018-10-26
问题已解决,"rollup-plugin-babel": "^4.0.3",此版本问题,执行npm install --save-dev rollup-plugin-babel@3即可
10 -
慕桂英5446361
2018-11-30
我的也报错 按照你的 配置文件来就可以了
{ "name": "rollup-cj", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "start": "rollup -c rollup.config.js", "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", "license": "ISC", "devDependencies": { "babel-core": "^6.26.3", "babel-plugin-external-helpers": "^6.22.0", "babel-preset-latest": "^6.24.1", "rollup": "^0.66.6", "rollup-plugin-babel": "^3.0.7", "rollup-plugin-node-resolve": "^3.4.0" } }
00 -
双越
2018-10-24
运行 npm install --save-dev babel-core 试一下
032018-10-25
相似问题