I'm trying to run npm init vite
on Ubuntu 22.04 LTS and node v12.22.9, but it gaves me this error
file:///home/giacomo/.npm/_npx/2c4a09cdd3a6d615/node_modules/create-vite/index.js:296
return targetDir?.trim().replace(/\/+$/g, '')
^
SyntaxError: Unexpected token '.'
at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18)
at async link (internal/modules/esm/module_job.js:42:21)
npm ERR! code 1
npm ERR! path /home/giacomo/Scrivania/html/3DWebApp
npm ERR! command failed
npm ERR! command sh -c create-vite
npm ERR! A complete log of this run can be found in:
npm ERR! /home/giacomo/.npm/_logs/2022-07-25T05_58_55_401Z-debug-0.log
I've tried other methods like npm init @vitejs/app
or npm create @vitejs/app
but they're deprecated.
There's a way i can manually fix it or there is another method to try?