2

There is an error with the Chart library that I'm using, and to fix this I should run this script: https://github.com/plouc/nivo/blob/master/scripts/patch-react-spring.js. prior to build. I have thought of adding "prebuild":"npm run patch-react-spring.js" and adding patch-react-spring.js file in the root directory under package.json. However when i do npm run patch-react-app or npm run prebuild i get the Error: npm ERR! missing script: patch-react-spring.js

This is the GitHub repo to the project: https://github.com/JonasHendel/SunPosition

1 Answers1

3

You can try using this library

https://www.npmjs.com/package/patch-package


    # fix a bug in one of your dependencies
    vim node_modules/some-package/brokenFile.js
    
    # run patch-package to create a .patch file
    npx patch-package some-package
    
    # commit the patch file to share the fix with your team
    git add patches/some-package+3.14.15.patch
    git commit -m "fix brokenFile.js in some-package"

In package.json

 "scripts": {
"postinstall": "patch-package"
 }
Hema Latha
  • 41
  • 4