私はvue.jsでLaravel 5.4を使用しています。それから私は作成されたメソッドとの間に構文エラーがありました。私は忘れた、私はこのエラーを修正します。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>
私は「NPMの実行DEV」または「NPMの実行ウォッチ」を書く場合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
EDIT
私はあなたのアドバイスやapplied.Iを聞き、問題が関連構文ではありません意味mistake.The問題は、古いコードで新しいcode.IのINSEADを実行して、すべてのファイルと、「NPMを保存dev "を実行しますが、毎回同じエラーが返されます。
どのノードのバージョンを使用していますか? – mscdex
あなたの完全なコンポーネントコードを表示する - それにもかかわらず、2つのecmascriptスタイルを混在させているようです –
ノードバージョン8.1.3 @mscdex – more