nopt.js:3 Uncaught ReferenceError: process is not defined
at node_modules/nopt/lib/nopt.js (nopt.js:3:13)
at __require2 (chunk-AUZ3RYOM.js?v=10a29a4e:18:50)
at node_modules/node-pre-gyp/lib/node-pre-gyp.js (node-pre-gyp.js:15:12)
at __require2 (chunk-AUZ3RYOM.js?v=10a29a4e:18:50)
at node_modules/opencc/node/opencc.js (opencc.js:30:21)
at __require2 (chunk-AUZ3RYOM.js?v=10a29a4e:18:50)
at opencc.js:130:1
tracker-base.js:11 Uncaught TypeError: util.inherits is not a function
at node_modules/are-we-there-yet/tracker-base.js (tracker-base.js:11:6)
at __require2 (chunk-AUZ3RYOM.js?v=10a29a4e:18:50)
at node_modules/are-we-there-yet/tracker-group.js (tracker-group.js:3:19)
at __require2 (chunk-AUZ3RYOM.js?v=10a29a4e:18:50)
at node_modules/are-we-there-yet/index.js (index.js:2:24)
at __require2 (chunk-AUZ3RYOM.js?v=10a29a4e:18:50)
at node_modules/npmlog/log.js (log.js:2:16)
at __require2 (chunk-AUZ3RYOM.js?v=10a29a4e:18:50)
at node_modules/node-pre-gyp/lib/node-pre-gyp.js (node-pre-gyp.js:16:11)
at __require2 (chunk-AUZ3RYOM.js?v=10a29a4e:18:50)
通过
yarn add BYVoid/OpenCC#ver.1.1.7
安装,用于vite+vue3项目,起初错误是:我通过
vite.config.ts
中定义全局变量解决了:但接着报错: