相同的代码,相同的依赖,相同的版本。卡了好久。网上也查了各种资料,前端也看了。都没找出来原因。。求助社区大佬
打包 log 报错,运行 log 中的 npm install 也没办法运行成功。
h236812@HON-AI:/var/lib/jenkins/workspace/t$ sudo /usr/local/bin/npm run prod
ssrtm@1.0.0 prod /var/lib/jenkins/workspace/t
cross-env UMI_ENV=prod umi build
@umijs/plugin-locale WARNING: antd is not installed, unavailable.
✖ Webpack
Compiled with some errors in 58.10s
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db
ERROR Failed to compile with 12 errors 8:42:33 AM
These dependencies were not found:
To install them, you can run: npm install --save /var/lib/jenkins/workspace/t/src/pages/TrailUser/register /var/lib/jenkins/workspace/t/src/pages/User/SetPwd @/pages/Home/Widgets/Widgets @/pages/Home/Widgets/tiles/weather/weatherUtil React
These relative modules were not found:
./utils/jsonUtil in ./src/framework/src/index.ts
Child
ERROR in ./src/pages/Home/Equipment/Equipment/components/BasicAsssetInfo/BasicAsssetInfo.tsx
Module not found: Error: Can't resolve './basicAsssetInfo.less?modules' in '/var/lib/jenkins/workspace/t/src/pages/Home/Equipment/Equipment/components/BasicAsssetInfo'
@ ./src/pages/Home/Equipment/Equipment/components/BasicAsssetInfo/BasicAsssetInfo.tsx 11:0-52 248:19-25 250:19-25 252:19-25 254:19-25 258:19-25 266:19-25 268:19-25 279:19-25 281:19-25 284:19-25 292:19-25 294:19-25 304:19-25 306:19-25 308:19-25 311:19-25 319:19-25 321:19-25 324:19-25 332:19-25 334:19-25
@ ./src/pages/Home/Equipment/Equipment/DetailAsset/DetailAsset.tsx
@ ./src/pages/Home/Equipment/EQManagement.tsx
@ ./src/.umi-production/core/routes.ts
@ ./src/.umi-production/umi.ts
@ multi ./src/.umi-production/umi.ts
ERROR in ./src/framework/src/index.ts
Module not found: Error: Can't resolve './utils/jsonUtil' in '/var/lib/jenkins/workspace/t/src/framework/src'
@ ./src/framework/src/index.ts 16:0-44 20:0-25:16
@ ./src/models/jobFunction.ts
@ ./src/.umi-production/plugin-dva/connect.ts
@ ./src/.umi-production/core/umiExports.ts
@ ./src/.umi-production/plugin-initial-state/Provider.tsx
@ ./src/.umi-production/plugin-initial-state/runtime.tsx
@ ./src/.umi-production/core/pluginRegister.ts
@ ./src/.umi-production/umi.ts
@ multi ./src/.umi-production/umi.ts
ERROR in ./src/.umi-production/core/routes.ts
Module not found: Error: Can't resolve '/var/lib/jenkins/workspace/t/src/pages/TrailUser/register' in '/var/lib/jenkins/workspace/t/src/.umi-production/core'
@ ./src/.umi-production/core/routes.ts 484:19-486:72
@ ./src/.umi-production/umi.ts
@ multi ./src/.umi-production/umi.ts
ERROR in ./src/.umi-production/core/routes.ts
Module not found: Error: Can't resolve '/var/lib/jenkins/workspace/t/src/pages/User/SetPwd' in '/var/lib/jenkins/workspace/t/src/.umi-production/core'
@ ./src/.umi-production/core/routes.ts 474:19-476:65
@ ./src/.umi-production/umi.ts
@ multi ./src/.umi-production/umi.ts
ERROR in ./src/.umi-production/core/routes.ts
Module not found: Error: Can't resolve '@/pages/Home/Widgets/Widgets' in '/var/lib/jenkins/workspace/t/src/.umi-production/core'
@ ./src/.umi-production/core/routes.ts 51:19-53:43
@ ./src/.umi-production/umi.ts
@ multi ./src/.umi-production/umi.ts
ERROR in ./src/models/weather.ts
Module not found: Error: Can't resolve '@/pages/Home/Widgets/tiles/weather/weatherUtil' in '/var/lib/jenkins/workspace/t/src/models'
@ ./src/models/weather.ts 4:0-82 236:12-28
@ ./src/.umi-production/plugin-dva/connect.ts
@ ./src/.umi-production/core/umiExports.ts
@ ./src/.umi-production/plugin-initial-state/Provider.tsx
@ ./src/.umi-production/plugin-initial-state/runtime.tsx
@ ./src/.umi-production/core/pluginRegister.ts
@ ./src/.umi-production/umi.ts
@ multi ./src/.umi-production/umi.ts
ERROR in ./src/pages/Home/Equipment/Components/ApplyTemplate/ApplyTemplate.tsx
Module not found: Error: Can't resolve 'React' in '/var/lib/jenkins/workspace/t/src/pages/Home/Equipment/Components/ApplyTemplate'
@ ./src/pages/Home/Equipment/Components/ApplyTemplate/ApplyTemplate.tsx 5:0-31 61:37-56 61:57-71 61:92-111 63:23-42 69:26-45 86:2-21
@ ./src/pages/Home/Equipment/Docks/DockDetail/DockSettings/DockSettings.tsx
@ ./src/pages/Home/Equipment/Docks/DockDetail/DockDetail.tsx
@ ./src/.umi-production/core/routes.ts
@ ./src/.umi-production/umi.ts
@ multi ./src/.umi-production/umi.ts
ERROR in ./src/pages/Home/Equipment/Components/ChangeDeviceStatus/ChangeDeviceStatus.tsx
Module not found: Error: Can't resolve 'React' in '/var/lib/jenkins/workspace/t/src/pages/Home/Equipment/Components/ChangeDeviceStatus'
@ ./src/pages/Home/Equipment/Components/ChangeDeviceStatus/ChangeDeviceStatus.tsx 5:0-31 66:37-56 66:57-71 66:92-111 68:23-42 74:26-45 91:2-21
@ ./src/pages/Home/Equipment/Docks/DockList.tsx
@ ./src/.umi-production/core/routes.ts
@ ./src/.umi-production/umi.ts
@ multi ./src/.umi-production/umi.ts
ERROR in ./src/pages/Home/Equipment/Components/SetParams/SetParams.tsx
Module not found: Error: Can't resolve 'React' in '/var/lib/jenkins/workspace/t/src/pages/Home/Equipment/Components/SetParams'
@ ./src/pages/Home/Equipment/Components/SetParams/SetParams.tsx 9:0-31 133:36-55 144:35-54 150:38-57 152:22-41 155:40-59 157:22-41 159:23-42 167:30-49 167:50-64 168:26-45 188:2-21
@ ./src/pages/Home/Equipment/Docks/DockList.tsx
@ ./src/.umi-production/core/routes.ts
@ ./src/.umi-production/umi.ts
@ multi ./src/.umi-production/umi.ts
ERROR in ./src/pages/Home/Equipment/Components/SetPassword/SetPassword.tsx
Module not found: Error: Can't resolve 'React' in '/var/lib/jenkins/workspace/t/src/pages/Home/Equipment/Components/SetPassword'
@ ./src/pages/Home/Equipment/Components/SetPassword/SetPassword.tsx 5:0-31 52:26-45 52:76-95 54:22-41 54:83-102 54:145-164 86:26-45 106:2-21
@ ./src/pages/Home/Equipment/Docks/DockList.tsx
@ ./src/.umi-production/core/routes.ts
@ ./src/.umi-production/umi.ts
@ multi ./src/.umi-production/umi.ts
ERROR in ./src/pages/Home/Organization/Sites/Site/Gateway/Components/ManuallyAssignDock/ManuallyAssignDock.tsx
Module not found: Error: Can't resolve 'React' in '/var/lib/jenkins/workspace/t/src/pages/Home/Organization/Sites/Site/Gateway/Components/ManuallyAssignDock'
@ ./src/pages/Home/Organization/Sites/Site/Gateway/Components/ManuallyAssignDock/ManuallyAssignDock.tsx 9:0-31 276:26-45 278:22-41 280:22-41 282:22-41 284:23-42 294:24-43 296:22-41 298:22-41 300:22-41 307:23-42 314:23-42 321:24-43 326:24-43 328:22-41 328:81-100 335:25-44 337:22-41 348:25-44 350:22-41 363:26-45 375:22-41 375:75-94 380:24-43 380:227-246 380:390-409 382:22-41 389:23-42 444:30-49 444:50-64 445:26-45 467:2-21
@ ./src/pages/Home/Organization/Sites/Site/Gateway/Info/GatewayInfo.tsx
@ ./src/.umi-production/core/routes.ts
@ ./src/.umi-production/umi.ts
@ multi ./src/.umi-production/umi.ts
ERROR in ./src/pages/Home/Schedule/Components/DeleteActivities/DeleteActivities.tsx
Module not found: Error: Can't resolve 'React' in '/var/lib/jenkins/workspace/t/src/pages/Home/Schedule/Components/DeleteActivities'
@ ./src/pages/Home/Schedule/Components/DeleteActivities/DeleteActivities.tsx 5:0-31 27:26-45 49:26-45 65:2-21
@ ./src/pages/Home/Schedule/ScheduleActivities.tsx
@ ./src/pages/Home/Schedule/Schedule.tsx
@ ./src/.umi-production/core/routes.ts
@ ./src/.umi-production/umi.ts
@ multi ./src/.umi-production/umi.ts
null
build failed
Error: build failed
at /var/lib/jenkins/workspace/t/node_modules/@umijs/bundler-webpack/lib/index.js:138:27
at finalCallback (/var/lib/jenkins/workspace/t/node_modules/webpack/lib/MultiCompiler.js:254:12)
at /var/lib/jenkins/workspace/t/node_modules/webpack/lib/MultiCompiler.js:277:6
at done (/var/lib/jenkins/workspace/t/node_modules/neo-async/async.js:2931:13)
at runCompilers (/var/lib/jenkins/workspace/t/node_modules/webpack/lib/MultiCompiler.js:181:48)
at /var/lib/jenkins/workspace/t/node_modules/webpack/lib/MultiCompiler.js:188:7
at /var/lib/jenkins/workspace/t/node_modules/webpack/lib/MultiCompiler.js:270:7
at finalCallback (/var/lib/jenkins/workspace/t/node_modules/webpack/lib/Compiler.js:257:39)
at /var/lib/jenkins/workspace/t/node_modules/webpack/lib/Compiler.js:273:13
at AsyncSeriesHook.eval as callAsync
at AsyncSeriesHook.lazyCompileHook (/var/lib/jenkins/workspace/t/node_modules/tapable/lib/Hook.js:154:20)
at onCompiled (/var/lib/jenkins/workspace/t/node_modules/webpack/lib/Compiler.js:271:21)
at /var/lib/jenkins/workspace/t/node_modules/webpack/lib/Compiler.js:681:15
at AsyncSeriesHook.eval as callAsync
at AsyncSeriesHook.lazyCompileHook (/var/lib/jenkins/workspace/t/node_modules/tapable/lib/Hook.js:154:20)
at /var/lib/jenkins/workspace/t/node_modules/webpack/lib/Compiler.js:678:31
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ssrtm@1.0.0 prod: cross-env UMI_ENV=prod umi build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ssrtm@1.0.0 prod script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/h236812/.npm/_logs/2021-05-13T00_42_33_802Z-debug.log