Override `npm install` script for NPM project

后端 未结 1 629
闹比i
闹比i 2021-02-13 15:53

I have an NPM project, when npm install is run, I\'d like to run a custom script.

I tried using this in package.json:

\"scripts\": {
    \"n         


        
相关标签:
1条回答
  • 2021-02-13 16:03

    Use preinstall to run code before npm install. Don't try to override npm install in this fashion where you would end up with an infinite loop of calls to npm install.

    You can also set environment variables using the config property of package.json. See docs for details

    0 讨论(0)
提交回复
热议问题