-4

I'm trying to add script to the script's watch in the package.json file. For example, I got:

{
"scripts": {
    "delete": "rm -f wwwroot/*.js wwwroot/*.css wwwroot/*.html wwwroot/*.map"
    "watch": "npm run delete; parcel watch Client/index.html --out-dir wwwroot"
  }
}

Then when I run npm run watch, in the terminal, it throw me this error:


> projectName@1.0.0 watch C:\Users\username\userProjectName\path\ProjectName
> npm run delete; parcel watch Client/index.html --out-dir wwwroot

npm ERR! missing script: delete;
npm ERR!
npm ERR! Did you mean this?
npm ERR!     delete

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\username\AppData\Roaming\npm-cache\_logs\2019-05-01T17_17_44_173Z-debug.lognpm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! projectName@1.0.0 watch: `npm run delete; parcel watch Client/index.html --out-dir wwwroot`
npm ERR! Exit status 1npm ERR!
npm ERR! Failed at the projectName@1.0.0 watch script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\username\AppData\Roaming\npm-cache\_logs\2019-05-01T17_17_44_193Z-debug.log

but when I run it manually, by this I mean to actually go to the terminal and type: npm run delete; parcel watch Client/index.html --out-dir wwwroot, it run perfectly

Josue Toledo
  • 349
  • 2
  • 3
  • 8

1 Answers1

3

You're simply missing a comma after the delete script.

{
"scripts": {
    "delete": "rm -f wwwroot/*.js wwwroot/*.css wwwroot/*.html wwwroot/*.map",
    "watch": "npm run delete; parcel watch Client/index.html --out-dir wwwroot"
  }
}
junvar
  • 11,151
  • 2
  • 30
  • 46