await import('source-map-support').then((r) => r.default.install()) #12287
Replies: 10 comments 8 replies
-
如果修改版本还不行,需注意的坑,请注意linux多版本情况下有可能自定义node名字,然后注意报错地方vite.js if (!import.meta.url.includes('node_modules')) { |
Beta Was this translation helpful? Give feedback.
-
facing the same problem here. Updated node to 20.2.0 and npm to 8.5.1 as of May 22th 2023, no changes. |
Beta Was this translation helpful? Give feedback.
-
For thoses using Debian 10 , you must install node from nodesource because apt default is v10 |
Beta Was this translation helpful? Give feedback.
-
am using ubuntu and facing the same problem |
Beta Was this translation helpful? Give feedback.
-
Turns out that my Node.js was installed incorrectly. Even though I updated my node version, it didn't actually update. My system was still using the old version of Node and NPM. To solve this, I completely uninstalled npm and Node by manually deleting their files. You can find their file path using the 'which node' and 'which npm' commands. This StackOverflow helped: After that, I globally reinstalled Node and npm using nvm, and the error was resolved. |
Beta Was this translation helpful? Give feedback.
-
same problem, it works when run "npm run dev", but fails with "sudo npm run dev". Im using node v 20.9.0 and npm v 10.1.0 |
Beta Was this translation helpful? Give feedback.
-
Switching to node 21.6.2 resolved it for me. |
Beta Was this translation helpful? Give feedback.
-
check if the nvm path is specified in .bashrc or .zshrc |
Beta Was this translation helpful? Give feedback.
-
I fix the issue by updating node js with nvm |
Beta Was this translation helpful? Give feedback.
-
I get this error when I try to run Vite.
file:///home/hduser/Documents/Fernando/Projects/adopt-me/node_modules/vite/bin/vite.js:7
await import('source-map-support').then((r) => r.default.install())
^^^^^
SyntaxError: Unexpected reserved word
at Loader.moduleStrategy (internal/modules/esm/translators.js:140:18)
at async link (internal/modules/esm/module_job.js:42:21)
I tried updating my node version, but no luck.
node: 19.4.0
vite: 3.1.4
@vitejs/plugin-react: 2.1.0
Beta Was this translation helpful? Give feedback.
All reactions