小程序在 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 [email protected] 3 info using [email protected] 4 verbose run-script [ 'predev:mp-weixin', 'dev:mp-weixin', 'postdev:mp-weixin' ] 5 info lifecycle [email protected]~predev:mp-weixin: [email protected] 6 info lifecycle [email protected]~dev:mp-weixin: [email protected] 7 verbose lifecycle [email protected]~dev:mp-weixin: unsafe-perm in lifecycle true 8 verbose lifecycle [email protected]~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 [email protected]~dev:mp-weixin: CWD: /Users/fjq/Desktop/jc-smart-uni-app-main 10 silly lifecycle [email protected]~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 [email protected]~dev:mp-weixin: Failed to exec dev:mp-weixin script 12 verbose stack Error: [email protected] 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 [email protected] 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 [email protected] 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 [email protected] 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)