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:\2022\Laravel Vue\laravel-vue-survey
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c create-vite "vue"
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Nalaka\AppData\Local\npm-cache\_logs\2022-12-20T06_31_44_838Z-debug-0.log
PS F:\2022\Laravel Vue\laravel-vue-survey> SyntaxError: Unexpected token '.'
how could I fix it?
CodePudding user response:
Try upgrading node. I bet its an older version
CodePudding user response:
You are trying to initialize a Vue
project with Vite. For that you should use the vite create
instead of npm init
.
vite create project-name vue