Home > Blockchain >  How to set npm script to blank via the command line?
How to set npm script to blank via the command line?

Time:09-30

When I ran npm set-script prepare "" (using npm version 8.15.0 in a Windows command prompt), a warning was output:

npm WARN set-script set-script is deprecated, use `npm pkg set scripts.scriptname="cmd"` instead.

So I followed the above instruction with npm pkg set scripts.prepare="" and this time an error was output:

npm ERR! code EUSAGE
npm ERR!
npm ERR! npm pkg set expects a key=value pair of args.

When I tried npm pkg set scripts.prepare=" " (note the space), this worked but it seems odd that a blank string isn't allowed. Is this a bug or a feature or is there another way?

CodePudding user response:

If you want to remove the script you could use:

npm pkg delete scripts.prepare

  • Related