ds300 / ds300/patch-package

works fail with jenkins

Open
#233 2 comments 3 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
11.2k
Forks
325
PR merge metrics
No merged PRs in 30d

Description

Package.json of project

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

build script in jenkins

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

error output from jenkins console

```sh
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 > vue-admin-template@4.2.1 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 bpmn-js@6.0.4 ✔
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! vue-admin-template@4.2.1 install: `patch-package`
22:23:33 npm ERR! Exit status 1
22:23:33 npm ERR!
22:23:33 npm ERR! Failed at the vue-admin-template@4.2.1 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
```sh
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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.