这个项目是上个同事搭建的,离职后没有留下任何交接文档,请问这中项目结构怎么运行?是需要在vscode下运行还是Hbuilder下运行?也不能打包成app,打包也会出错,(本人已经1年多没接触过uniapp,之前运用的基本都忘记了,百度了很久也解决不了),希望各位大佬们能帮忙看看!!!非常感激!!! 下面附带了项目结构截图
第一张图片是项目结构截图
第二张是uniapp运行报错信息
后面的是package.json截图****
在vscode下运行指令:npm run dev:app 会报错
错误信息:
PS F:\workspace\aolong-eip-classcard> npm run dev:app
Debugger attached.
uni-preset-vue@0.0.0 dev:app
uni -p app
Debugger attached.
请注意运行模式下,因日志输出、sourcemap 以及未压缩源码等原因,性能和包体积,均不及发行模式。
编译器版本:4.08(vue3)
正在编译中...
failed to load config from F:\workspace\aolong-eip-classcard\vite.config.ts
error during build:
Error [ERR_REQUIRE_ESM]: require() of ES Module F:\workspace\aolong-eip-classcard\node_modules\unocss\dist\vite.
Instead change the require of F:\workspace\aolong-eip-classcard\node_modules\unocss\dist\vite.mjs to a dynamic i in all CommonJS modules.
es/vite/dist/node/chunks/dep-934dbc7c.js:64314:28)
at async resolveConfig (file:///F:/workspace/aolong-eip-classcard/node_modules/vite/dist/node/chunks/dep-934dbc7c.js:63922:28)
at async Module.build (file:///F:/workspace/aolong-eip-classcard/node_modules/vite/dist/node/chunks/dep-934dbc7c.js:46282:20)
at async buildApp (F:\workspace\aolong-eip-classcard\node_modules\@dcloudio\vite-plugin-uni\dist\cli\build.js:123:24)
at async CAC.runDev (F:\workspace\aolong-eip-classcard\node_modules\@dcloudio\vite-plugin-uni\dist\cli\action.js:56:30)
Waiting for the debugger to disconnect...
Waiting for the debugger to disconnect...
在uniapp下运行也会报错:
17:21:15.806 项目 'aolong-eip-classcard' 开始编译...
17:21:18.539 请注意运行模式下,因日志输出、sourcemap 以及未压缩源码等原因,性能和包体积,均不及发行模式。
17:21:18.540 vite是按需编译,运行时点击某个未编译页面会先编译后加载,导致显示较慢,发行后无此问题。
17:21:18.549 编译器版本:4.08(vue3)
17:21:18.553 正在编译中...
17:21:18.842 failed to load config from F:\workspace\aolong-eip-classcard\vite.config.ts
17:21:18.844 error when starting dev server:
17:21:18.848 Error [ERR_REQUIRE_ESM]: require() of ES Module F:\workspace\aolong-eip-classcard\node_modules\unocss\dist\vite.mjs not supported.
17:21:18.852 Instead change the require of F:\workspace\aolong-eip-classcard\node_modules\unocss\dist\vite.mjs to a dynamic import() which is available in all CommonJS modules.
17:21:18.856 at Object.<anonymous> (F:\workspace\aolong-eip-classcard\vite.config.ts:38:28)
17:21:18.856 at _require.extensions.<computed> [as .js] (file:///F:/workspace/aolong-eip-classcard/node_modules/vite/dist/node/chunks/dep-934dbc7c.js:64450:24)
17:21:18.861 at loadConfigFromBundledFile (file:///F:/workspace/aolong-eip-classcard/node_modules/vite/dist/node/chunks/dep-934dbc7c.js:64458:21)
17:21:18.866 at async loadConfigFromFile (file:///F:/workspace/aolong-eip-classcard/node_modules/vite/dist/node/chunks/dep-934dbc7c.js:64314:28)
17:21:18.870 at async resolveConfig (file:///F:/workspace/aolong-eip-classcard/node_modules/vite/dist/node/chunks/dep-934dbc7c.js:63922:28)
17:21:18.870 at async _createServer (file:///F:/workspace/aolong-eip-classcard/node_modules/vite/dist/node/chunks/dep-934dbc7c.js:63206:20)
17:21:18.874 at async createServer (F:\workspace\aolong-eip-classcard\node_modules\@dcloudio\vite-plugin-uni\dist\cli\server.js:44:20)
17:21:18.875 at async CAC.runDev (F:\workspace\aolong-eip-classcard\node_modules\@dcloudio\vite-plugin-uni\dist\cli\action.js:50:28)