Error Cannot find module ‘worker_threads‘ [How to Solve]

Error: Cannot find module ‘worker_ ‘threads’ solution

Try vite to create Vue project for the first time, and run NPM run dev with an error

This is a node version problem. Version 12 or above is required

PS D:\qian_duan-learn\vue3-learn\vue3demo02> node -v
v10.13.0
PS D:\qian_duan-learn\vue3-learn\vue3demo02> 

Just upgrade the node version

npm install -g n (mac need to add sudo)
n latest

Of course, it is more recommended that you use NVM to install multiple node versions to meet the requirements of different projects

Read More: