patch-package icon indicating copy to clipboard operation
patch-package copied to clipboard

works fail with jenkins

Open marryton007 opened this issue 4 years ago • 2 comments

Package.json of project

  "scripts": {
    "dev": "vue-cli-service serve",
    ...
    "install": "patch-package"
  }

build script in jenkins

echo $PATH
cd web
node -v
npm install --unsafe-perm
npm run build:prod

error output from jenkins console

22:23:15 + cd web
22:23:15 + node -v
22:23:15 v8.16.2
22:23:15 + npm install --unsafe-perm
22:23:32 
22:23:32 > [email protected] install /var/lib/jenkins/workspace/realty-vue-web/web
22:23:32 > patch-package
22:23:32 
22:23:33 patch-package 6.2.2
22:23:33 Applying patches...
22:23:33 [email protected] ✔
22:23:33 
22:23:33 **ERROR** Failed to apply patch for package bpmn-js-properties-panel at path
22:23:33   
22:23:33     node_modules/bpmn-js-properties-panel
22:23:33 
22:23:33   This error was caused because patch-package cannot apply the following patch file:
22:23:33 
22:23:33     patches/bpmn-js-properties-panel+0.33.0.patch
22:23:33 
22:23:33   Try removing node_modules and trying again. If that doesn't work, maybe there was
22:23:33   an accidental change made to the patch file? Try recreating it by manually
22:23:33   editing the appropriate files and running:
22:23:33   
22:23:33     patch-package bpmn-js-properties-panel
22:23:33   
22:23:33   If that doesn't work, then it's a bug in patch-package, so please submit a bug
22:23:33   report. Thanks!
22:23:33 
22:23:33     https://github.com/ds300/patch-package/issues
22:23:33     
22:23:33 
22:23:33 npm ERR! code ELIFECYCLE
22:23:33 npm ERR! errno 1
22:23:33 npm ERR! [email protected] install: `patch-package`
22:23:33 npm ERR! Exit status 1
22:23:33 npm ERR! 
22:23:33 npm ERR! Failed at the [email protected] install script.
22:23:33 npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
22:23:33 
22:23:33 npm ERR! A complete log of this run can be found in:
22:23:33 npm ERR!     /root/.npm/_logs/2020-05-09T14_23_33_725Z-debug.log
22:23:33 Build step 'Execute shell' marked build as failure

I should remove the directory like follow and then jenkins build successed

cd  /var/lib/jenkins/workspace/realty-vue-web/web
rm -rf node_modules/bpmn-js-properties-panel

I guess the patch file can't be applied because the node_modules/package_xx has be patched. It seems I need delete the node_modues/packages_xx before execute npm install

Any suggestions? Thanks a lot.

marryton007 avatar May 09 '20 15:05 marryton007

牛逼 plus

lovexyy avatar Aug 13 '21 11:08 lovexyy

Thank you

RGM-89sc avatar Aug 13 '21 11:08 RGM-89sc