我有一个vueJs webpack的问题,我想在服务器上运行npm run dev命令。但是我收到以下错误消息。
请问有人能告诉我如何解决它吗?非常感谢!
错误信息:
npm ERR! code EJSONPARSE npm ERR! Failed to parse json npm ERR! Unexpected token / while parsing '{ npm ERR! "name": "vue-loader-demo", npm ERR! "versio' npm ERR! File: /Users/sylvia/Documents/FE/Practice/vue/vue-loader-demo/package.json npm ERR! Failed to parse package.json data. npm ERR! package.json must be actual JSON, not just JavaScript. npm ERR! npm ERR! Tell the package author to fix their package.json file. JSON.parse npm ERR! A complete log of this run can be found in: npm ERR! /Users/sylvia/.npm/_logs/2018-04-17T12_39_56_372Z-debug.log
这是package.json:
请问有人能告诉我如何解决它吗?非常感谢!
错误信息:
npm ERR! code EJSONPARSE npm ERR! Failed to parse json npm ERR! Unexpected token / while parsing '{ npm ERR! "name": "vue-loader-demo", npm ERR! "versio' npm ERR! File: /Users/sylvia/Documents/FE/Practice/vue/vue-loader-demo/package.json npm ERR! Failed to parse package.json data. npm ERR! package.json must be actual JSON, not just JavaScript. npm ERR! npm ERR! Tell the package author to fix their package.json file. JSON.parse npm ERR! A complete log of this run can be found in: npm ERR! /Users/sylvia/.npm/_logs/2018-04-17T12_39_56_372Z-debug.log
这是package.json:
{
"name": "vue-loader-demo",
"version": "1.0.0",
"description": "",
"main": "main.js",
"scripts": {
"build": "webpack",
"dev": "webpack-dev-server --devtool eval --progress --colors --hot"
},
"author": "",
"license": "ISC",
"dependencies": {
"webpack": "^4.5.0",
"webpack-dev-server": "^3.1.3"
}
}
webpack.config.js
module.exports={
entry:'./main.js',
output:{
path:_dirname, filename:‘'bundle.js'’
} }
文件结构
|-index.html(网页主文件)
|-main.js(主要的JS代码)
|-App.vue(Vue.js框架组件)
|-package.json(项目配置文件)
|-webpack.config.js(Webpack打包配置文件)
bundle.js
看起来不对劲。 - ceejayoz