錯誤信息
12:58:12.378 failed to load config from vite.config.ts
12:58:12.381 error during build:
12:58:12.381 /xxxpath/node_modules/@unocss/vite/dist/index.cjs:238
12:58:12.384 ? ? ? ? return command === "build" && !options.build?.ssr;
12:58:12.386 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?^
12:58:12.388 SyntaxError: Unexpected token '.'
12:58:12.390 ? ? at wrapSafe (internal/modules/cjs/loader.js:915:16)
12:58:12.394 ? ? at Module._compile (internal/modules/cjs/loader.js:963:27)
12:58:12.397 ? ? at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
12:58:12.398 ? ? at Module.load (internal/modules/cjs/loader.js:863:32)
12:58:12.400 ? ? at Function.Module._load (internal/modules/cjs/loader.js:708:14)
12:58:12.402 ? ? at Module.require (internal/modules/cjs/loader.js:887:19)
12:58:12.404 ? ? at require (internal/modules/cjs/helpers.js:74:18)
12:58:12.404 ? ? at Object.<anonymous> (/xxxpath/node_modules/unocss/dist/vite.cjs:5:20)
12:58:12.407 ? ? at Module._compile (internal/modules/cjs/loader.js:999:30)
12:58:12.409 ? ? at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
錯誤截圖
??
解決方案
HBuilderX -> 偏好設(shè)置 -> 運行配置 -> node路徑 -> 重啟 HBuilderX
查看 node 路徑
$ which node
/Users/null/.nvm/versions/node/v14.19.3/bin/node
文章來源:http://www.zghlxwxcb.cn/news/detail-506740.html
?文章來源地址http://www.zghlxwxcb.cn/news/detail-506740.html
到了這里,關(guān)于HBuilderX 編譯 Uniapp 微信小程序失敗的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!