第一次创建vue3出现的坑,爬坑之旅

首先直接用hBuilder新建的vue3.2.8的项目,建好后直接运行就出现了报错

Error: Cannot find module 'worker_threads'


> [email protected] dev
> vite

internal/modules/cjs/loader.js:589
    throw err;
    ^

Error: Cannot find module 'worker_threads'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:587:15)
    at Function.Module._load (internal/modules/cjs/loader.js:513:25)
    at Module.require (internal/modules/cjs/loader.js:643:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object. (/Users/nantou/Desktop/project/vue3-demo/node_modules/vite/dist/node/chunks/dep-1be34a63.js:26:20)
    at Module._compile (internal/modules/cjs/loader.js:707:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:718:10)
    at Module.load (internal/modules/cjs/loader.js:605:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:544:12)
    at Function.Module._load (internal/modules/cjs/loader.js:536:3)
buyaochiwodemantoudeMacBook-Air:vue3-demo nantou$ node -v
v18.15.0

首先查了说是node版本太低问题,但是我查了一下,我的电脑版本node是 v18.15.0所以不会node版本问题。

你可能感兴趣的:(Vue,javascript,前端,vue.js)