【发布时间】:2018-05-24 02:31:56
【问题描述】:
我想用 npm 设置 webpack 和 babel,但是我收到了这个错误
npm ERR! Unexpected end of JSON input while parsing near '...pdragon":"^0.7.0","to' npm ERR! A complete log of this run can be found in:
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\luchan.vladyslav\AppData\Roaming\npm-cache\_logs\2017-12-10T10_48_56_298Z-debug.log
这是我的 package.json
{
"name": "ddd",
"version": "1.0.0",
"description": "components",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-preset-env": "^1.6.1"
}
}
一开始我尝试在一行中安装 webpack webpack-dev-server babel-core babel-loader 和 babel-preset-env。但是我得到了这个错误,过了一会儿我发现这个问题与 webpack 和 wepback-dev-server 有关
【问题讨论】:
-
你的 json 中没有额外的尾随逗号吗?
-
dferner,不,我没有
标签: javascript npm webpack installation