我是靠谱客的博主 陶醉未来,这篇文章主要介绍HBuilderX 编译 Uniapp 微信小程序失败,现在分享给大家,希望可以做个参考。

错误信息

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 -> 偏好设置 -> 运行配置 -> node路径 -> 重启 HBuilderX

查看 node 路径

$ which node
/Users/null/.nvm/versions/node/v14.19.3/bin/node

 

最后

以上就是陶醉未来最近收集整理的关于HBuilderX 编译 Uniapp 微信小程序失败的全部内容,更多相关HBuilderX内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(36)

评论列表共有 0 条评论

立即
投稿
返回
顶部