0
我使用Laravel 5.4和vue.js。然后,我有创建和方法之间的语法错误。我忘了,然后我修复这个错误。npm缓存问题 - 没有重建
但仍然错误继续。
<script>
export default {
data(){
return {
users: []
}
},
created(){
this.fetchUsers();
},//forgotten
methods:{ //41.line
fetchUsers(){
this.$http.get('/users').then(response => {
this.users = response.data.users;
});
}
}
}
</script>
我重新启动,如果我写“故宫运行dev的”或“故宫运行表” apache.But仍然有此错误。
error in ./resources/assets/js/components/Users.vue
Syntax Error: Unexpected token, expected , (41:4)
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @ development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @ development script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/ubuntu/.npm/_logs/2017-07-11T08_13_41_572Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @ dev: `npm run development`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @ dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/ubuntu/.npm/_logs/2017-07-11T08_13_41_618Z-debug.log
编辑
我听你的意见和applied.I意味着这个问题是不相关的语法错了。问题是旧的代码执行新code.I的INSEAD保存的所有文件,然后“NPM运行开发“,但每次都返回相同的错误。
你使用什么节点版本? – mscdex
显示你的完整的组件代码 - 不过,你似乎混合两个ecmascript样式 –
节点版本8.1.3 @mscdex – more