简体   繁体   中英

Electron NPM ERR! Missing Script: Start

I know this has been asked before, but that question did not help me at all! So I am trying to make an Electron app using its tutorial , and whenever I try and run my code, this error pops up:

npm ERR! missing script: start

Here is my package.json:

{
"name": "my-electron-app",
"version": "1.0.0",
"description": "",
"main": "main.js",
"scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "electron ."
    },
    "keywords": [],
    "author": "",
    "license": "ISC"
}

So what am I doing wrong?

Strange. I can't think of many reasons why this is happening. I have a few ideas that may help.

  1. Check you are in the correct folder to run the command
  2. Attempt npm run start instead

If neither of these work, there may be something else that is missing

Ok for those of you who had a similar problem, try using a different shell. I was using WSL and when I tried Windows command prompt everything worked just fine.

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