going to install vue as using following commnd npm init vite vue
in a laravel project. but when I try it got following error message in my terminal
SyntaxError: Unexpected token '.'
at Loader.moduleStrategy (internal/modules/esm/translators.js:140:18)
npm ERR! code 1
npm ERR! path F:2022Laravel + Vuelaravel-vue-survey
npm ERR! command failed
npm ERR! command C:Windowssystem32cmd.exe /d /s /c create-vite "vue"
npm ERR! A complete log of this run can be found in:
npm ERR! C:UsersNalakaAppDataLocalnpm-cache_logs2022-12-20T06_31_44_838Z-debug-0.log
PS F:2022Laravel + Vuelaravel-vue-survey> SyntaxError: Unexpected token '.'
how could I fix it?
2
Answers
Try upgrading node. I bet its an older version
You are trying to initialize a
Vue
project with Vite. For that you should use thevite create
instead ofnpm init
.