skip to Main Content

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


  1. Try upgrading node. I bet its an older version

    Login or Signup to reply.
  2. 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
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search