持续交付 前端 REACT 代码在 linux 上打包有问题,windows、mac 上都没有问题。求助

一枚小菜鸡 · 2021年05月18日 · 最后由 UDLD 回复于 2021年09月24日 · 5207 次阅读

相同的代码,相同的依赖,相同的版本。卡了好久。网上也查了各种资料,前端也看了。都没找出来原因。。求助社区大佬

打包 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:

  • /var/lib/jenkins/workspace/t/src/pages/TrailUser/register in ./src/.umi-production/core/routes.ts
  • /var/lib/jenkins/workspace/t/src/pages/User/SetPwd in ./src/.umi-production/core/routes.ts
  • @/pages/Home/Widgets/Widgets in ./src/.umi-production/core/routes.ts
  • @/pages/Home/Widgets/tiles/weather/weatherUtil in ./src/models/weather.ts
  • React in ./src/pages/Home/Equipment/Components/ApplyTemplate/ApplyTemplate.tsx, ./src/pages/Home/Equipment/Components/ChangeDeviceStatus/ChangeDeviceStatus.tsx and 4 others

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:

  • ./basicAsssetInfo.less?modules in ./src/pages/Home/Equipment/Equipment/components/BasicAsssetInfo/BasicAsssetInfo.tsx
  • ./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

共收到 5 条回复 时间 点赞
✖ 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:

/var/lib/jenkins/workspace/t/src/pages/TrailUser/register in ./src/.umi-production/core/routes.ts
/var/lib/jenkins/workspace/t/src/pages/User/SetPwd in ./src/.umi-production/core/routes.ts
@/pages/Home/Widgets/Widgets in ./src/.umi-production/core/routes.ts
@/pages/Home/Widgets/tiles/weather/weatherUtil in ./src/models/weather.ts
React in ./src/pages/Home/Equipment/Components/ApplyTemplate/ApplyTemplate.tsx, ./src/pages/Home/Equipment/Components/ChangeDeviceStatus/ChangeDeviceStatus.tsx and 4 others

打包的错是因为缺少依赖导致,要通过装依赖解决。装依赖(npm install)的错贴上来看看?

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

使用npm install --save安装一下,如果 npm 因为墙的问题,那就是用 cnpm 安装也是一样

完整的 log

08:56:40 Started by user admin
08:56:40 Running as SYSTEM
08:56:40 Building in workspace /var/lib/jenkins/workspace/t
08:56:40 The recommended git tool is: NONE
08:56:40 using credential d5383b4b-1c43-4cf9-b242-9c0dea274b39
08:56:41 > /usr/bin/git rev-parse --is-inside-work-tree # timeout=10
08:56:41 Fetching changes from the remote Git repository
08:56:41 > /usr/bin/git config remote.origin.url https://bitbucket.honeywell.com/scm/ssrtm/web.git # timeout=10
08:56:41 Fetching upstream changes from https://bitbucket.honeywell.com/scm/ssrtm/web.git
08:56:41 > /usr/bin/git --version # timeout=10
08:56:41 > git --version # 'git version 1.9.1'
08:56:41 using GIT_ASKPASS to set credentials
08:56:41 > /usr/bin/git fetch --tags --progress https://bitbucket.honeywell.com/scm/ssrtm/web.git +refs/heads/:refs/remotes/origin/ # timeout=10
08:57:40 > /usr/bin/git rev-parse origin/develop{commit} # timeout=10
08:57:40 Checking out Revision 1364ef6bd7acab12193f08dade85fa6a3a9f0138 (origin/develop)
08:57:40 > /usr/bin/git config core.sparsecheckout # timeout=10
08:57:40 > /usr/bin/git checkout -f 1364ef6bd7acab12193f08dade85fa6a3a9f0138 # timeout=10
08:57:42 Commit message: "Pull request #2129: Feature/lee/refine dock seting logic"
08:57:42 > /usr/bin/git rev-list --no-walk 8095d4a2d20efdca1b16e65f5aa1fb5517ff5ad7 # timeout=10
08:57:42 > /usr/bin/git remote # timeout=10
08:57:42 > /usr/bin/git submodule init # timeout=10
08:57:42 > /usr/bin/git submodule sync # timeout=10
08:57:43 > /usr/bin/git config --get remote.origin.url # timeout=10
08:57:43 > /usr/bin/git submodule init # timeout=10
08:57:43 > /usr/bin/git config -f .gitmodules --get-regexp submodule.(.+).url # timeout=10
08:57:43 > /usr/bin/git config --get submodule.src/framework.url # timeout=10
08:57:43 > /usr/bin/git remote # timeout=10
08:57:43 > /usr/bin/git config --get remote.origin.url # timeout=10
08:57:43 > /usr/bin/git config -f .gitmodules --get submodule.src/framework.path # timeout=10
08:57:43 using GIT_ASKPASS to set credentials
08:57:43 > /usr/bin/git submodule update --init --recursive src/framework # timeout=10
08:57:43 [t] $ /bin/sh -xe /tmp/jenkins8760771604762758088.sh
08:57:43 + npm -v
08:57:46 6.14.11
08:57:46 + sudo npm config set @scuf:registry https://artifactory-na.honeywell.com/artifactory/api/npm/SCUF-10305-stable-npm-local/
09:04:48 + sudo npm install
09:06:49
09:06:49 added 6 packages, and audited 3909 packages in 2m
09:06:50
09:06:50 130 vulnerabilities (13 low, 88 moderate, 29 high)
09:06:50
09:06:50 To address issues that do not require attention, run:
09:06:50 npm audit fix
09:06:50
09:06:50 To address all issues possible (including breaking changes), run:
09:06:50 npm audit fix --force
09:06:50
09:06:50 Some issues need review, and may require choosing
09:06:50 a different dependency.
09:06:50
09:06:50 Run npm audit for details.
09:06:50 + sudo npm run prod
09:06:50
09:06:50 > ssrtm@1.0.0 prod
09:06:50 > node changeFileNames && node copyThemeFile && cross-env UMI_ENV=prod umi build
09:06:50
09:07:29 @umijs/plugin-locale WARNING: antd is not installed, unavailable.
09:07:45 ℹ Compiling Webpack
09:08:00 Browserslist: caniuse-lite is outdated. Please run:
09:08:00 npx browserslist@latest --update-db
09:09:33 ✔ Webpack: Compiled with some errors in 1.81m
09:09:33 ERROR Failed to compile with 11 errors9:09:33 AM
09:09:33
09:09:33 These dependencies were not found:
09:09:33
09:09:33 * /var/lib/jenkins/workspace/t/src/pages/TrailUser/register in ./src/.umi-production/core/routes.ts
09:09:33 * /var/lib/jenkins/workspace/t/src/pages/User/SetPwd in ./src/.umi-production/core/routes.ts
09:09:33 * @/pages/Home/Widgets/Widgets in ./src/.umi-production/core/routes.ts
09:09:33 * @/pages/Home/Widgets/tiles/weather/weatherUtil in ./src/models/weather.ts
09:09:33 * React in ./src/pages/Home/Equipment/Components/ApplyTemplate/ApplyTemplate.tsx, ./src/pages/Home/Equipment/Components/ChangeDeviceStatus/ChangeDeviceStatus.tsx and 3 others
09:09:33
09:09:33 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
09:09:33
09:09:33
09:09:33 These relative modules were not found:
09:09:33
09:09:33 * ./basicAsssetInfo.less?modules in ./src/pages/Home/Equipment/Equipment/components/BasicAsssetInfo/BasicAsssetInfo.tsx
09:09:33 * ./utils/jsonUtil in ./src/framework/src/index.ts
09:09:33 Child
09:09:33

09:09:33 ERROR in ./src/pages/Home/Equipment/Equipment/components/BasicAsssetInfo/BasicAsssetInfo.tsx
09:09:33 Module not found: Error: Can't resolve './basicAsssetInfo.less?modules' in '/var/lib/jenkins/workspace/t/src/pages/Home/Equipment/Equipment/components/BasicAsssetInfo'
09:09:33 @ ./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
09:09:33 @ ./src/pages/Home/Equipment/Equipment/DetailAsset/DetailAsset.tsx
09:09:33 @ ./src/pages/Home/Equipment/EQManagement.tsx
09:09:33 @ ./src/.umi-production/core/routes.ts
09:09:33 @ ./src/.umi-production/umi.ts
09:09:33 @ multi ./src/.umi-production/umi.ts
09:09:33

09:09:33 ERROR in ./src/framework/src/index.ts
09:09:33 Module not found: Error: Can't resolve './utils/jsonUtil' in '/var/lib/jenkins/workspace/t/src/framework/src'
09:09:33 @ ./src/framework/src/index.ts 16:0-44 20:0-25:16
09:09:33 @ ./src/pages/Home/Map/DeviceData/DeviceDetailModal/DeviceDetailModal.js
09:09:33 @ ./src/pages/Home/Map/DeviceData/DeviceData.js
09:09:33 @ ./src/pages/Home/Map/RealTimeMonitor.js
09:09:33 @ ./src/.umi-production/core/routes.ts
09:09:33 @ ./src/.umi-production/umi.ts
09:09:33 @ multi ./src/.umi-production/umi.ts
09:09:33

09:09:33 ERROR in ./src/.umi-production/core/routes.ts
09:09:33 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'
09:09:33 @ ./src/.umi-production/core/routes.ts 484:19-486:72
09:09:33 @ ./src/.umi-production/umi.ts
09:09:33 @ multi ./src/.umi-production/umi.ts
09:09:33

09:09:33 ERROR in ./src/.umi-production/core/routes.ts
09:09:33 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'
09:09:33 @ ./src/.umi-production/core/routes.ts 474:19-476:65
09:09:33 @ ./src/.umi-production/umi.ts
09:09:33 @ multi ./src/.umi-production/umi.ts
09:09:33

09:09:33 ERROR in ./src/.umi-production/core/routes.ts
09:09:33 Module not found: Error: Can't resolve '@/pages/Home/Widgets/Widgets' in '/var/lib/jenkins/workspace/t/src/.umi-production/core'
09:09:33 @ ./src/.umi-production/core/routes.ts 51:19-53:43
09:09:33 @ ./src/.umi-production/umi.ts
09:09:33 @ multi ./src/.umi-production/umi.ts
09:09:33

09:09:33 ERROR in ./src/models/weather.ts
09:09:33 Module not found: Error: Can't resolve '@/pages/Home/Widgets/tiles/weather/weatherUtil' in '/var/lib/jenkins/workspace/t/src/models'
09:09:33 @ ./src/models/weather.ts 4:0-82 236:12-28
09:09:33 @ ./src/.umi-production/plugin-dva/dva.ts
09:09:33 @ ./src/.umi-production/plugin-dva/runtime.tsx
09:09:33 @ ./src/.umi-production/core/pluginRegister.ts
09:09:33 @ ./src/.umi-production/umi.ts
09:09:33 @ multi ./src/.umi-production/umi.ts
09:09:33

09:09:33 ERROR in ./src/pages/Home/Equipment/Components/ApplyTemplate/ApplyTemplate.tsx
09:09:33 Module not found: Error: Can't resolve 'React' in '/var/lib/jenkins/workspace/t/src/pages/Home/Equipment/Components/ApplyTemplate'
09:09:33 @ ./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
09:09:33 @ ./src/pages/Home/Equipment/EquipmentInfo/EQProfile/EQSetting.tsx
09:09:33 @ ./src/pages/Home/Equipment/Docks/DockDetail/DockSettings/DockTreeView/DockTreeView.tsx
09:09:33 @ ./src/pages/Home/Equipment/Template/DockTemplate/DockTemplate.tsx
09:09:33 @ ./src/.umi-production/core/routes.ts
09:09:33 @ ./src/.umi-production/umi.ts
09:09:33 @ multi ./src/.umi-production/umi.ts
09:09:33

09:09:33 ERROR in ./src/pages/Home/Equipment/Components/ChangeDeviceStatus/ChangeDeviceStatus.tsx
09:09:33 Module not found: Error: Can't resolve 'React' in '/var/lib/jenkins/workspace/t/src/pages/Home/Equipment/Components/ChangeDeviceStatus'
09:09:33 @ ./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
09:09:33 @ ./src/pages/Home/Equipment/Docks/DockList.tsx
09:09:33 @ ./src/.umi-production/core/routes.ts
09:09:33 @ ./src/.umi-production/umi.ts
09:09:33 @ multi ./src/.umi-production/umi.ts
09:09:33

09:09:33 ERROR in ./src/pages/Home/Equipment/Components/SetParams/SetParams.tsx
09:09:33 Module not found: Error: Can't resolve 'React' in '/var/lib/jenkins/workspace/t/src/pages/Home/Equipment/Components/SetParams'
09:09:33 @ ./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
09:09:33 @ ./src/pages/Home/Equipment/Docks/DockList.tsx
09:09:33 @ ./src/.umi-production/core/routes.ts
09:09:33 @ ./src/.umi-production/umi.ts
09:09:33 @ multi ./src/.umi-production/umi.ts
09:09:33

09:09:33 ERROR in ./src/pages/Home/Equipment/Components/SetPassword/SetPassword.tsx
09:09:33 Module not found: Error: Can't resolve 'React' in '/var/lib/jenkins/workspace/t/src/pages/Home/Equipment/Components/SetPassword'
09:09:33 @ ./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
09:09:33 @ ./src/pages/Home/Equipment/Docks/DockList.tsx
09:09:33 @ ./src/.umi-production/core/routes.ts
09:09:33 @ ./src/.umi-production/umi.ts
09:09:33 @ multi ./src/.umi-production/umi.ts
09:09:33

09:09:33 ERROR in ./src/pages/Home/Organization/Sites/Site/Gateway/Components/ManuallyAssignDock/ManuallyAssignDock.tsx
09:09:33 Module not found: Error: Can't resolve 'React' in '/var/lib/jenkins/workspace/t/src/pages/Home/Organization/Sites/Site/Gateway/Components/ManuallyAssignDock'
09:09:33 @ ./src/pages/Home/Organization/Sites/Site/Gateway/Components/ManuallyAssignDock/ManuallyAssignDock.tsx 9:0-31 285:26-45 287:22-41 289:22-41 291:22-41 293:23-42 304:24-43 306:22-41 308:22-41 310:22-41 317:23-42 324:23-42 331:24-43 336:25-44 338:22-41 349:25-44 351:22-41 363:26-45 365:22-41 370:28-47 382:26-45 443:30-49 443:50-64 444:26-45 444:46-60 444:81-100 466:2-21
09:09:33 @ ./src/pages/Home/Organization/Sites/Site/Gateway/Info/GatewayInfo.tsx
09:09:33 @ ./src/.umi-production/core/routes.ts
09:09:33 @ ./src/.umi-production/umi.ts
09:09:33 @ multi ./src/.umi-production/umi.ts
09:09:33 null
09:09:33 build failed
09:09:33 Error: build failed
09:09:33 at /var/lib/jenkins/workspace/t/node_modules/@umijs/bundler-webpack/lib/index.js:138:27
09:09:33 at finalCallback (/var/lib/jenkins/workspace/t/node_modules/webpack/lib/MultiCompiler.js:254:12)
09:09:33 at /var/lib/jenkins/workspace/t/node_modules/webpack/lib/MultiCompiler.js:277:6
09:09:33 at done (/var/lib/jenkins/workspace/t/node_modules/neo-async/async.js:2931:13)
09:09:33 at runCompilers (/var/lib/jenkins/workspace/t/node_modules/webpack/lib/MultiCompiler.js:181:48)
09:09:33 at /var/lib/jenkins/workspace/t/node_modules/webpack/lib/MultiCompiler.js:188:7
09:09:33 at /var/lib/jenkins/workspace/t/node_modules/webpack/lib/MultiCompiler.js:270:7
09:09:33 at finalCallback (/var/lib/jenkins/workspace/t/node_modules/webpack/lib/Compiler.js:257:39)
09:09:33 at /var/lib/jenkins/workspace/t/node_modules/webpack/lib/Compiler.js:273:13
09:09:33 at AsyncSeriesHook.eval as callAsync
09:09:33 at AsyncSeriesHook.lazyCompileHook (/var/lib/jenkins/workspace/t/node_modules/tapable/lib/Hook.js:154:20)
09:09:33 at onCompiled (/var/lib/jenkins/workspace/t/node_modules/webpack/lib/Compiler.js:271:21)
09:09:33 at /var/lib/jenkins/workspace/t/node_modules/webpack/lib/Compiler.js:681:15
09:09:33 at AsyncSeriesHook.eval as callAsync
09:09:33 at AsyncSeriesHook.lazyCompileHook (/var/lib/jenkins/workspace/t/node_modules/tapable/lib/Hook.js:154:20)
09:09:33 at /var/lib/jenkins/workspace/t/node_modules/webpack/lib/Compiler.js:678:31
09:09:33 Build step 'Execute shell' marked build as failure
09:09:34 Finished: FAILURE

有几个点想确认下:

1、你说的 windows、mac 上没问题,是这两个系统上的 jenkins 没问题,还是纯粹这两个系统上普通用户执行命令行没问题?
2、跑下 npm list --depth=0 ,看下你实际 npm install 装了哪些包;也 cat package.json 看看,是不是里面定义的 dependencies 都装上了?
3、可以把你没问题环境上的 npm installnpm list --depth=0 输出日志也补充上来,对比下有啥差别?

从目前日志上看,有两个比较特别的点需要留意,但需要先确认上面几个点:

1、npm install 没报错,但装的包有点少,才 6 个(added 6 packages, and audited 3909 packages)。一般前端项目应该不至于只有这么点依赖。
2、编译报错里面,除了少数是外部依赖(如 React),其他大多是内部依赖(如 /var/lib/jenkins/workspace/t/src/pages/TrailUser/register in ./src/.umi-production/core/routes.ts)。不确定是不是路径解析时根路径不一样或者别的原因导致。

看了下您的帖子,觉得不错可以进一步交流,请问考虑机会吗,直聘? https://testerhome.com/topics/31014

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册