本文介绍了如何为Reaction应用程序创建Azure DevOps构建管道的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经创建了一个构建管道,其中包含2个NPM任务、安装程序,然后是带有参数的定制脚本Run-脚本构建,如截图所示
但是我收到错误,这在日志中
##[section]Starting: npm custom
==============================================================================
Task : npm
Description : Install and publish npm packages, or run an npm command. Supports npmjs.com and authenticated registries like Package Management.
Version : 1.148.0
Author : Microsoft Corporation
Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=613746)
==============================================================================
SYSTEMVSSCONNECTION exists true
SYSTEMVSSCONNECTION exists true
[command]C:windowssystem32cmd.exe /D /S /C "C:
pmprefix
pm.cmd --version"
6.8.0
[command]C:windowssystem32cmd.exe /D /S /C "C:
pmprefix
pm.cmd config list"
; cli configs
metrics-registry = "https://registry.npmjs.org/"
scope = ""
user-agent = "npm/6.8.0 node/v10.15.2 win32 x64"
; environment configs
cache = "C:\npm\cache"
prefix = "C:\npm\prefix"
userconfig = "D:\a\1\npm\94.npmrc"
; builtin config undefined
; node bin location = C:Program Files
odejs
ode.exe
; cwd = D:a1s
; HOME = C:UsersVssAdministrator
; "npm config ls -l" to show all defaults.
[command]C:windowssystem32cmd.exe /D /S /C "C:
pmprefix
pm.cmd run-script build"
npm ERR! code ELIFECYCLE
npm ERR! errno 1
> [email protected] build D:a1s
npm ERR! [email protected] build: `react-app-rewired build`
> react-app-rewired build
npm ERR! Exit status 1
npm ERR!
Creating an optimized production build...
npm ERR! Failed at the [email protected] build script.
Failed to compile.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Cannot read property 'thisCompilation' of undefined
npm ERR! A complete log of this run can be found in:
npm ERR! C:
pmcache\_logs2019-03-18T22_28_26_738Z-debug.log
Found npm debug log, make sure the path matches with the one in npm's output: C:
pmcache\_logs2019-03-18T22_28_26_738Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\npm\prefix\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'run-script',
1 verbose cli 'build' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle [email protected]~prebuild: [email protected]
6 info lifecycle [email protected]~build: [email protected]
7 verbose lifecycle [email protected]~build: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~build: PATH: C:
pmprefix
ode_modules
pm
ode_modules
pm-lifecycle
ode-gyp-bin;D:a1s
ode_modules.bin;C:agents2.148.1externalsgitcmd;C:/hostedtoolcache/windows/Python/3.6.8/x64;C:/hostedtoolcache/windows/Python/3.6.8/x64/Scripts;C:vcpkg;C:cf-cli;C:Program Files (x86)NSIS;C:Program FilesBoost1.69.0;C:UsersVssAdministrator.dotnet ools;C:Program Filesdotnet;C:mysql-5.7.21-winx64in;C:Program FilesJavazulu-8-azure-jdk_8.36.0.1-8.0.202-win_x64in;C:
pmprefix;C:hostedtoolcachewindowsRuby2.5.0x64in;C:Go1.11.5in;C:Program FilesGitin;C:Program FilesGitusrin;C:Program FilesGitmingw64in;C:Program Files (x86)Microsoft SDKsAzureCLI2wbin;C:Program Files (x86)Microsoft Visual StudioSharedPython36_64Scripts;C:Program Files (x86)Microsoft Visual StudioSharedPython36_64;C:Program FilesMicrosoft MPIBin;C:windowssystem32;C:windows;C:windowsSystem32Wbem;C:windowsSystem32WindowsPowerShellv1.0;C:ProgramDataChocolateyin;C:Program FilesDocker;C:Program FilesPowerShell6;C:Program Filesdotnet;C:Program FilesMicrosoft SQL Server130ToolsBinn;C:Program Files (x86)Microsoft SQL Server110DTSBinn;C:Program Files (x86)Microsoft SQL Server120DTSBinn;C:Program Files (x86)Microsoft SQL Server130DTSBinn;C:Program Files (x86)Microsoft SQL Server140DTSBinn;C:Program Files (x86)Microsoft SQL Server150DTSBinn;C:Program Files (x86)Windows Kits10Windows Performance Toolkit;C:Program FilesMicrosoft Service FabricinFabricFabric.Code;C:Program FilesMicrosoft SDKsService FabricToolsServiceFabricLocalClusterManager;C:Program FilesGitcmd;C:Program FilesGitmingw64in;C:Program FilesGitusrin;c: oolsphp;C:Program Files (x86)Subversionin;C:Program Files
odejs;C:Program FilesCMakein;C:Program FilesMercurial;C:Strawberrycin;C:Strawberryperlsitein;C:Strawberryperlin;C:Program FilesOpenSSLin;C:UsersVssAdministratorAppDataLocalMicrosoftWindowsApps;
9 verbose lifecycle [email protected]~build: CWD: D:a1s
10 silly lifecycle [email protected]~build: Args: [ '/d /s /c', 'react-app-rewired build' ]
11 silly lifecycle [email protected]~build: Returned: code: 1 signal: null
12 info lifecycle [email protected]~build: Failed to exec build script
13 verbose stack Error: [email protected] build: `react-app-rewired build`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:
pmprefix
ode_modules
pm
ode_modules
pm-lifecycleindex.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:189:13)
13 verbose stack at ChildProcess.<anonymous> (C:
pmprefix
ode_modules
pm
ode_modules
pm-lifecyclelibspawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:189:13)
13 verbose stack at maybeClose (internal/child_process.js:970:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid [email protected]
15 verbose cwd D:a1s
16 verbose Windows_NT 10.0.14393
17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\npm\prefix\node_modules\npm\bin\npm-cli.js" "run-script" "build"
18 verbose node v10.15.2
19 verbose npm v6.8.0
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] build: `react-app-rewired build`
22 error Exit status 1
23 error Failed at the [email protected] build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
##[error]Error: Npm failed with return code: 1
##[section]Finishing: npm custom
Package.json
{
"name": "isomorphic",
"version": "2.6.0",
"private": true,
"dependencies": {
"adal-angular": "^1.0.17",
"antd": "^3.0.3",
"antd-local-icon": "^0.1.3",
"axios": "^0.18.0",
"classnames": "^2.2.5",
"clone": "^2.1.1",
"history": "^4.6.3",
"nprogress": "^0.2.0",
"postcss-inline-rtl": "^0.9.8",
"q": "^1.5.1",
"react": "^16.2.0",
"react-adal": "^0.4.17",
"react-dom": "^16.2.0",
"react-highlight-words": "^0.16.0",
"react-intl": "^2.3.0",
"react-placeholder": "^2.0.0",
"react-redux": "^5.0.4",
"react-router": "^4.1.1",
"react-router-dom": "^4.1.0",
"react-router-redux": "^5.0.0-alpha.5",
"react-scripts": "1.0.17",
"react-sidebar": "^2.3.2",
"react-smooth-scrollbar": "^8.0.6",
"react-throttle": "^0.3.0",
"react-window-size-listener": "^1.0.10",
"redux": "^3.6.0",
"redux-devtools": "^3.3.2",
"redux-devtools-dock-monitor": "^1.1.1",
"redux-devtools-log-monitor": "^1.2.0",
"redux-saga": "^0.16.0",
"redux-thunk": "^2.2.0",
"smooth-scrollbar": "^8.2.5",
"styled-components": "^2.2.1",
"styled-theme": "^0.3.3",
"webpack-cli": "^3.2.3"
},
"devDependencies": {
"react-app-rewired": "^1.4.0",
"webpack": "^4.29.5"
},
"scripts": {
"start": "react-app-rewired start",
"build": "react-app-rewired build",
"test": "react-app-rewired test --env=jsdom",
"eject": "react-scripts eject"
}
}
推荐答案
错误非常明显...看看你的日志。有一行:
因此,在您的代码中,它不会显示您的逻辑上存在错误的确切位置,并且您可能有一个空指针,因此Java编译器失败。
我遇到了类似的问题,已在应用程序代码中修复,开发环境中没有捕捉到警告/错误,只是我们尝试在Azure管道中进行构建。
我希望它能帮助其他有类似问题的人。
这篇关于如何为Reaction应用程序创建Azure DevOps构建管道的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!