求助!启动微信小程序的时候报错,不知道怎么解决

2022-10-18 17:22:57 +08:00
 normaljq

小程序在 npm run dev:mp-weixin 的时候会报如下错误,google 查了下还是不知道怎么改

错误信息日志


0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'dev:mp-weixin' ]
2 info using npm@6.14.17
3 info using node@v16.17.0
4 verbose run-script [ 'predev:mp-weixin', 'dev:mp-weixin', 'postdev:mp-weixin' ]
5 info lifecycle jc-smart-uni-app@0.2.0~predev:mp-weixin: jc-smart-uni-app@0.2.0
6 info lifecycle jc-smart-uni-app@0.2.0~dev:mp-weixin: jc-smart-uni-app@0.2.0
7 verbose lifecycle jc-smart-uni-app@0.2.0~dev:mp-weixin: unsafe-perm in lifecycle true
8 verbose lifecycle jc-smart-uni-app@0.2.0~dev:mp-weixin: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/fjq/Desktop/jc-smart-uni-app-main/node_modules/.bin:/opt/homebrew/bin:/Library/Frameworks/Python.framework/Versions/3.9/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/mysql/bin:/Users/fjq/environment/apache-maven-3.6.3/bin
9 verbose lifecycle jc-smart-uni-app@0.2.0~dev:mp-weixin: CWD: /Users/fjq/Desktop/jc-smart-uni-app-main
10 silly lifecycle jc-smart-uni-app@0.2.0~dev:mp-weixin: Args: [
10 silly lifecycle   '-c',
10 silly lifecycle   'cross-env NODE_ENV=development UNI_PLATFORM=mp-weixin vue-cli-service uni-build --watch'
10 silly lifecycle ]
11 info lifecycle jc-smart-uni-app@0.2.0~dev:mp-weixin: Failed to exec dev:mp-weixin script
12 verbose stack Error: jc-smart-uni-app@0.2.0 dev:mp-weixin: `cross-env NODE_ENV=development UNI_PLATFORM=mp-weixin vue-cli-service uni-build --watch`
12 verbose stack spawn ENOENT
12 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:48:18)
12 verbose stack     at ChildProcess.emit (node:events:513:28)
12 verbose stack     at maybeClose (node:internal/child_process:1093:16)
12 verbose stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
13 verbose pkgid jc-smart-uni-app@0.2.0
14 verbose cwd /Users/fjq/Desktop/jc-smart-uni-app-main
15 verbose Darwin 21.6.0
16 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "dev:mp-weixin"
17 verbose node v16.17.0
18 verbose npm  v6.14.17
19 error code ELIFECYCLE
20 error syscall spawn
21 error file sh
22 error errno ENOENT
23 error jc-smart-uni-app@0.2.0 dev:mp-weixin: `cross-env NODE_ENV=development UNI_PLATFORM=mp-weixin vue-cli-service uni-build --watch`
23 error spawn ENOENT
24 error Failed at the jc-smart-uni-app@0.2.0 dev:mp-weixin script.
24 error This is probably not a problem with npm. There is likely additional logging output above.
25 verbose exit [ 1, true ]

微信开发工具编译后,会在Console中报错 错误信息

VM538:9 app.js 错误:
 Error: Cannot find module '@/app.config'
    at webpackMissingModule (index.ts:1)
    at Module.<anonymous> (index.ts:1)
    at Module._ (current-user.ts:27)
    at __webpack_require__ (bootstrap:91)
    at Module._ (index.ts:1)
    at __webpack_require__ (bootstrap:91)
    at Module.<anonymous> (App.vue?c220:1)
    at Module._ (App.vue?vue&type=script&lang=ts&:58)
    at __webpack_require__ (bootstrap:91)
    at Module._ (App.vue?c220:1)(env: macOS,mp,1.06.2209190; lib: 2.25.1)

774 次点击
所在节点    前端开发
0 条回复

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/887841

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX