讨论 Bug反馈 Uniapp模块编译出错

Uniapp模块编译出错

WX_pX4 发表于    阅读:50    回复:6

问题描述:

按照https://modstart.com/doc/manual/uniapp.html#%E7%A7%BB%E5%8A%A8%E7%AB%AFh5%E5%89%8D%E7%AB%AF%E4%BB%A3%E7%A0%81%E4%BD%8D%E7%BD%AE

用模块助手生成了一个uniapp模块,然手按照文档逐步操作, 在Hbuilder中编译H5报错,如截屏。请问是文档没有及时更新吗?需要修改哪里?`Can't resolve './../brick/theme.less'`, 在brick 路径下没有找到任何theme.less 文件。

jpg.svguni-app-error.jpg

jpg.svguni-app-error.jpg

环境信息:

PHP8.1、MSCore V3.8.0 ( With LARAVEL9 )                

复现步骤:

1

2

3

建议与意见:

评论

是哪一个模块?

 

安装“模块开发助手”了后, 在它的’工具栏‘中我选择了生成一个Uniapp移动端模块(如截屏所示)。然后按照开发文档安装依赖及配置,在“4 运行项目# H5页面”中试图编译到H5,得到那个编译错误。

56495_h6yz_1399.jpg


 

获取最新的模块 ModuleDeveloper 再试一下。

 

必须用node 14 吗?在`mobile` folder 下,运行 `cnpm install` 很多依赖都已经depreciated:

```shell

$ cnpm install
✔ Linked 1343 latest versions fallback to /Users/jianglin/Desktop/devprojects/city-connect/module/CityConnectMobile/resources/mobile/node_modules/.store/node_modules
✔ Linked 146 public hoist packages to /Users/jianglin/Desktop/devprojects/city-connect/module/CityConnectMobile/resources/mobile/node_modules
peerDependencies WARNING less-loader@^5.0.0 requires a peer of less@^2.3.1 || ^3.0.0 but /Users/jianglin/Desktop/devprojects/city-connect/module/CityConnectMobile/resources/mobile/node_modules/less was installed at less@4.2.0, packageDir: /Users/jianglin/Desktop/devprojects/city-connect/module/CityConnectMobile/resources/mobile/node_modules/.store/less-loader@5.0.0/node_modules/less-loader
peerDependencies WARNING @dcloudio/uni-automator@^2.0.1-33520211229002 requires a peer of adbkit@^2.11.1 but none was installed, packageDir: /Users/jianglin/Desktop/devprojects/city-connect/module/CityConnectMobile/resources/mobile/node_modules/.store/@dcloudio+uni-automator@2.0.1-alpha-36920221121001/node_modules/@dcloudio/uni-automator
peerDependencies WARNING @dcloudio/uni-automator@^2.0.1-33520211229002 requires a peer of jimp@^0.10.1 but none was installed, packageDir: /Users/jianglin/Desktop/devprojects/city-connect/module/CityConnectMobile/resources/mobile/node_modules/.store/@dcloudio+uni-automator@2.0.1-alpha-36920221121001/node_modules/@dcloudio/uni-automator
peerDependencies WARNING @dcloudio/uni-automator@^2.0.1-33520211229002 requires a peer of node-simctl@^6.1.0 but none was installed, packageDir: /Users/jianglin/Desktop/devprojects/city-connect/module/CityConnectMobile/resources/mobile/node_modules/.store/@dcloudio+uni-automator@2.0.1-alpha-36920221121001/node_modules/@dcloudio/uni-automator
peerDependencies WARNING @dcloudio/uni-automator@^2.0.1-33520211229002 requires a peer of puppeteer@^3.0.1 but none was installed, packageDir: /Users/jianglin/Desktop/devprojects/city-connect/module/CityConnectMobile/resources/mobile/node_modules/.store/@dcloudio+uni-automator@2.0.1-alpha-36920221121001/node_modules/@dcloudio/uni-automator
deprecate @vue/cli-plugin-babel@4.5.19 › @vue/babel-preset-app@4.5.19 › @babel/plugin-proposal-class-properties@^7.8.3 This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
deprecate @vue/cli-service@4.5.19 › html-webpack-plugin@^3.2.0 3.x is no longer supported
deprecate @vue/cli-plugin-babel@4.5.19 › @vue/cli-shared-utils@4.5.19 › request@^2.88.2 request has been deprecated, see https://github.com/request/request/issues/3142
deprecate @vue/cli-service@4.5.19 › webpack-chain@^6.4.0 Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
deprecate vue@^2.6.11 Vue 2 has reached EOL and is no longer actively maintained. See https://v2.vuejs.org/eol/ for more details.
deprecate @dcloudio/uni-cli-i18n@2.0.1-alpha-36920221121001 › i18n@0.13.4 › messageformat@^2.3.0 Package renamed as '@messageformat/core', see messageformat.github.io for more details. 'messageformat@4' will eventually provide a polyfill for Intl.MessageFormat, once it's been defined by Unicode & ECMA.
deprecate @vue/cli-plugin-babel@4.5.19 › @vue/cli-shared-utils@4.5.19 › @hapi/joi@^15.0.1 Switch to 'npm install joi'
deprecate @vue/cli-plugin-babel@4.5.19 › @vue/cli-shared-utils@4.5.19 › request@2.88.2 › har-validator@~5.1.3 this library is no longer supported
deprecate @vue/cli-plugin-babel@4.5.19 › @vue/cli-shared-utils@4.5.19 › request@2.88.2 › uuid@^3.3.2 Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
deprecate @dcloudio/uni-quickapp-native@2.0.1-alpha-36920221121001 › @hap-toolkit/packager@0.6.13 › koa-router@^7.4.0 **IMPORTANT 10x+ PERFORMANCE UPGRADE**: Please upgrade to v12.0.1+ as we have fixed an issue with debuglog causing 10x slower router benchmark performance, see https://github.com/koajs/router/pull/173
deprecate @vue/cli-service@4.5.19 › @vue/component-compiler-utils@3.3.0 › consolidate@^0.15.1 Please upgrade to consolidate v1.0.0+ as it has been modernized with several long-awaited fixes implemented. Maintenance is supported by Forward Email at https://forwardemail.net ; follow/watch https://github.com/ladjs/consolidate for updates and release changelog
deprecate @vue/cli-plugin-babel@4.5.19 › @vue/cli-shared-utils@4.5.19 › @hapi/joi@15.1.1 › @hapi/topo@3.x.x This version has been deprecated and is no longer supported or maintained
deprecate @dcloudio/vue-cli-plugin-hbuilderx@2.0.1-alpha-36920221121001 › css@2.2.4 › urix@^0.1.0 Please see https://github.com/lydell/urix#deprecated
deprecate @vue/cli-plugin-babel@4.5.19 › @vue/cli-shared-utils@4.5.19 › @hapi/joi@15.1.1 › @hapi/bourne@1.x.x This version has been deprecated and is no longer supported or maintained
deprecate @dcloudio/vue-cli-plugin-hbuilderx@2.0.1-alpha-36920221121001 › css@2.2.4 › source-map-resolve@^0.5.2 See https://github.com/lydell/source-map-resolve#deprecated
deprecate @vue/cli-plugin-babel@4.5.19 › @vue/cli-shared-utils@4.5.19 › @hapi/joi@15.1.1 › @hapi/address@2.x.x Moved to 'npm install @sideway/address'
deprecate @vue/cli-plugin-babel@4.5.19 › @vue/cli-shared-utils@4.5.19 › @hapi/joi@15.1.1 › @hapi/hoek@8.x.x This version has been deprecated and is no longer supported or maintained
deprecate @vue/cli-service@4.5.19 › copy-webpack-plugin@5.1.2 › cacache@12.0.4 › figgy-pudding@^3.5.1 This module is no longer supported.
deprecate @dcloudio/uni-quickapp-native@2.0.1-alpha-36920221121001 › @hap-toolkit/server@0.6.13 › koa-body@4.2.0 › formidable@^1.1.1 Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau
deprecate @vue/cli-service@4.5.19 › webpack-dev-server@3.11.3 › chokidar@^2.1.8 Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
deprecate @dcloudio/vue-cli-plugin-hbuilderx@2.0.1-alpha-36920221121001 › css@2.2.4 › source-map-resolve@0.5.3 › source-map-url@^0.4.0 See https://github.com/lydell/source-map-url#deprecated
deprecate @dcloudio/vue-cli-plugin-hbuilderx@2.0.1-alpha-36920221121001 › css@2.2.4 › source-map-resolve@0.5.3 › resolve-url@^0.2.1 https://github.com/lydell/resolve-url#deprecated
deprecate @vue/cli-service@4.5.19 › webpack-dev-server@3.11.3 › chokidar@2.1.8 › fsevents@^1.2.7 The v1 package contains DANGEROUS / INSECURE binaries. Upgrade to safe fsevents v2
deprecate jest@25.5.4 › @jest/core@25.5.4 › jest-haste-map@25.5.1 › sane@^4.0.3 some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
deprecate @vue/cli-service@4.5.19 › @intervolga/optimize-cssnano-plugin@1.0.6 › cssnano-preset-default@4.0.8 › postcss-svgo@4.0.3 › svgo@^1.0.0 This SVGO version is no longer supported. Upgrade to v2.x.x.
deprecate @vue/cli-service@4.5.19 › @intervolga/optimize-cssnano-plugin@1.0.6 › cssnano-preset-default@4.0.8 › postcss-svgo@4.0.3 › svgo@1.3.2 › stable@^0.1.8 Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
deprecate jest@25.5.4 › jest-cli@25.5.4 › jest-config@25.5.4 › jest-environment-jsdom@25.5.0 › jsdom@15.2.1 › abab@^2.0.0 Use your platform's native atob() and btoa() methods instead
deprecate jest@25.5.4 › jest-cli@25.5.4 › jest-config@25.5.4 › jest-environment-jsdom@25.5.0 › jsdom@15.2.1 › request-promise-native@^1.0.7 request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
deprecate jest@25.5.4 › jest-cli@25.5.4 › jest-config@25.5.4 › jest-environment-jsdom@25.5.0 › jsdom@15.2.1 › domexception@^1.0.1 Use your platform's native DOMException instead
deprecate jest@25.5.4 › jest-cli@25.5.4 › jest-config@25.5.4 › jest-environment-jsdom@25.5.0 › jsdom@15.2.1 › w3c-hr-time@^1.0.1 Use your platform's native performance.now() and performance.timeOrigin.
deprecate node-sass@4.14.1 › node-gyp@3.8.0 › tar@^2.0.0 This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
deprecate @dcloudio/uni-quickapp-native@2.0.1-alpha-36920221121001 › @hap-toolkit/server@0.6.13 › @hap-toolkit/debugger@0.6.15 › socket.io@2.5.0 › debug@~4.1.0 Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)

```,

在Hbuilder 中运行项目到H5页面中,出现以下错误:

```

0:48:19.252 [警告⚠] `../node_modules/.store/@dcloudio+uni-h5@2.0.1-alpha-36920221121001/node_modules/@dcloudio/uni-h5/dist/index.umd.min.js` 文件体积超过 500KB,已跳过压缩以及 ES6 转 ES5 的处理,手机端使用过大的js库影响性能。
10:48:24.431 Module build failed (from ./node_modules/.store/postcss-loader@3.0.0/node_modules/postcss-loader/src/index.js):
10:48:24.435 Error: Cannot find module 'postcss-import'
10:48:24.436 Require stack:
10:48:24.438 - /Users/jianglin/Desktop/devprojects/city-connect/module/CityConnectMobile/resources/mobile/postcss.config.js
10:48:24.438 - /Users/jianglin/Desktop/devprojects/city-connect/module/CityConnectMobile/resources/mobile/node_modules/.store/import-fresh@2.0.0/node_modules/import-fresh/index.js
10:48:24.441 - /Users/jianglin/Desktop/devprojects/city-connect/module/CityConnectMobile/resources/mobile/node_modules/.store/cosmiconfig@5.2.1/node_modules/cosmiconfig/dist/loaders.js
10:48:24.444 - /Users/jianglin/Desktop/devprojects/city-connect/module/CityConnectMobile/resources/mobile/node_modules/.store/cosmiconfig@5.2.1/node_modules/cosmiconfig/dist/createExplorer.js
10:48:24.447 - /Users/jianglin/Desktop/devprojects/city-connect/module/CityConnectMobile/resources/mobile/node_modules/.store/cosmiconfig@5.2.1/node_modules/cosmiconfig/dist/index.js
10:48:24.450 - /Users/jianglin/Desktop/devprojects/city-connect/module/CityConnectMobile/resources/mobile/node_modules/.store/postcss-load-config@2.1.2/node_modules/postcss-load-config/src/index.js
10:48:24.453 - /Users/jianglin/Desktop/devprojects/city-connect/module/CityConnectMobile/resources/mobile/node_modules/.store/postcss-loader@3.0.0/node_modules/postcss-loader/src/index.js
10:48:24.456 - /Users/jianglin/Desktop/devprojects/city-connect/module/CityConnectMobile/resources/mobile/node_modules/.store/loader-runner@2.4.0/node_modules/loader-runner/lib/loadLoader.js
10:48:24.456 - /Users/jianglin/Desktop/devprojects/city-connect/module/CityConnectMobile/resources/mobile/node_modules/.store/loader-runner@2.4.0/node_modules/loader-runner/lib/LoaderRunner.js
10:48:24.459 - /Users/jianglin/Desktop/devprojects/city-connect/module/CityConnectMobile/resources/mobile/node_modules/.store/webpack@4.47.0/node_modules/webpack/lib/NormalModule.js
10:48:24.462 - /Users/jianglin/Desktop/devprojects/city-connect/module/CityConnectMobile/resources/mobile/node_modules/.store/webpack@4.47.0/node_modules/webpack/lib/NormalModuleFactory.js
10:48:24.465 - /Users/jianglin/Desktop/devprojects/city-connect/module/CityConnectMobile/resources/mobile/node_modules/.store/webpack@4.47.0/node_modules/webpack/lib/Compiler.js
10:48:24.466 - /Users/jianglin/Desktop/devprojects/city-connect/module/CityConnectMobile/resources/mobile/node_modules/.store/webpack@4.47.0/node_modules/webpack/lib/webpack.js
10:48:24.468 - /Users/jianglin/Desktop/devprojects/city-connect/module/CityConnectMobile/resources/mobile/node_modules/.store/@dcloudio+vue-cli-plugin-uni@2.0.1-alpha-36920221121001/node_modules/@dcloudio/vue-cli-plugin-uni/commands/build.js
10:48:24.472 - /Users/jianglin/Desktop/devprojects/city-connect/module/CityConnectMobile/resources/mobile/node_modules/.store/@dcloudio+vue-cli-plugin-uni@2.0.1-alpha-36920221121001/node_modules/@dcloudio/vue-cli-plugin-uni/index.js
10:48:24.475 - /Users/jianglin/Desktop/devprojects/city-connect/module/CityConnectMobile/resources/mobile/node_modules/.store/@vue+cli-service@4.5.19/node_modules/@vue/cli-service/lib/Service.js
10:48:24.478 - /Users/jianglin/Desktop/devprojects/city-connect/module/CityConnectMobile/resources/mobile/node_modules/.store/@vue+cli-service@4.5.19/node_modules/@vue/cli-service/bin/vue-cli-service.js
10:48:24.480     at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15)
10:48:24.483     at Function.Module._resolveFilename (/Users/jianglin/Desktop/devprojects/city-connect/module/CityConnectMobile/resources/mobile/node_modules/.store/module-alias@2.2.3/node_modules/module-alias/index.js:49:29)
10:48:24.485     at Function.Module._load (node:internal/modules/cjs/loader:804:27)
10:48:24.488     at Module.require (node:internal/modules/cjs/loader:1028:19)
10:48:24.490     at require (node:internal/modules/cjs/helpers:102:18)
10:48:24.492     at Object.<anonymous> (/Users/jianglin/Desktop/devprojects/city-connect/module/CityConnectMobile/resources/mobile/postcss.config.js:5:5)
10:48:24.492     at Module._compile (node:internal/modules/cjs/loader:1126:14)
10:48:24.494     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
10:48:24.496     at Module.load (node:internal/modules/cjs/loader:1004:32)
10:48:24.498     at Function.Module._load (node:internal/modules/cjs/loader:839:12)
10:48:24.500     at Module.require (node:internal/modules/cjs/loader:1028:19)
10:48:24.501     at require (node:internal/modules/cjs/helpers:102:18)
10:48:24.502     at /Users/jianglin/Desktop/devprojects/city-connect/module/CityConnectMobile/resources/mobile/node_modules/.store/import-fresh@2.0.0/node_modules/import-fresh/index.js:28:9
10:48:24.505     at loadJs (/Users/jianglin/Desktop/devprojects/city-connect/module/CityConnectMobile/resources/mobile/node_modules/.store/cosmiconfig@5.2.1/node_modules/cosmiconfig/dist/loaders.js:9:18)
10:48:24.508     at Explorer.loadFileContent (/Users/jianglin/Desktop/devprojects/city-connect/module/CityConnectMobile/resources/mobile/node_modules/.store/cosmiconfig@5.2.1/node_modules/cosmiconfig/dist/createExplorer.js:230:12)
10:48:24.511     at /Users/jianglin/Desktop/devprojects/city-connect/module/CityConnectMobile/resources/mobile/node_modules/.store/cosmiconfig@5.2.1/node_modules/cosmiconfig/dist/createExplorer.js:252:21
10:48:24.514 文件查找失败:'md5' at brick/lib/util.js:24
```

H5页面

H5页面


 

只在 node 14 下测试过,其他的没有测试,遇到问题需要自行解决。

看后面的 md5 报错是缺少依赖

 
1
我来评论
QQ
微信