简体   繁体   中英

Package.json script error “missing script: package-mac”

I'm using the tutorial found here to package my electron app.

The best workflow (imho) is to define all the package settings within package.json's script property. I've done so, and from the tutorial above, you can then run the following command to package it:

npm run package-mac

This used to work; I packaged an app this way a few months ago. Now I'm getting an error:

missing script: package-mac

I'm in the correct directory and everything seems to match my previous project where important. My package.json definitely has the "package-mac" property.

There's only two occurrences of this error message online (not on SO), neither received responses and were posted relatively recent.

Any ideas why this stopped working?

Turns out my package.json syntax was a bit messed up, in a way that didn't produce an error (what are the chances).

Once the syntax was corrected, it worked fine.

Make sure "script" is at the top level of the package.json properties.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM