We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
6.5.0
windows 7
node v12.16.3 npm v6.14.4 yarn v1.12.1
add code on the first or last line, when reinstall, the code is repeated
init environment
>yarn init >yarn add -D patch-package postinstall-postinstall >yarn add [email protected]
add "scripts": { "postinstall": "patch-package" }, to package.json
"scripts": { "postinstall": "patch-package" },
edit file "node_modules/axios/index.js", add var aaa = 3; to the first line
var aaa = 3;
var aaa = 3; module.exports = require('./lib/axios');
save file and run command:
>yarn patch-package axios
patch-package will then generate the file: axios+0.21.4.patch
diff --git a/node_modules/axios/index.js b/node_modules/axios/index.js index 79dfd09..c995a6f 100644 --- a/node_modules/axios/index.js +++ b/node_modules/axios/index.js @@ -1 +1,2 @@ +var aaa = 3; module.exports = require('./lib/axios'); \ No newline at end of file
then remove directory "node_modules", reinstall package
>yarn install
the new file is (node_modules/axios/index.js)
var aaa = 3; var aaa = 3; module.exports = require('./lib/axios');
You can see that the modified code appears twice, The same problem occurs when code is added at the end
every time you run yarn patch-package
yarn patch-package
a new code var aaa = 3; will be add to the file
The text was updated successfully, but these errors were encountered:
I liiked a bit into it, here is what I've found:
npm install
postinstall-postinstall
Seems like postinstall-postinstall makes problems.
Sorry, something went wrong.
No branches or pull requests
version
6.5.0
Environment
windows 7
node v12.16.3
npm v6.14.4
yarn v1.12.1
Current Behavior
add code on the first or last line, when reinstall, the code is repeated
Steps to Reproduce
init environment
add
"scripts": { "postinstall": "patch-package" },
to package.jsonedit file "node_modules/axios/index.js", add
var aaa = 3;
to the first linesave file and run command:
patch-package will then generate the file: axios+0.21.4.patch
then remove directory "node_modules", reinstall package
the new file is (node_modules/axios/index.js)
You can see that the modified code appears twice, The same problem occurs when code is added at the end
every time you run
yarn patch-package
a new code
var aaa = 3;
will be add to the fileThe text was updated successfully, but these errors were encountered: