Skip to content
← Back to Community
[SOLVED] Electron npm ERR! missing script: start
Profile icon
Squirrel777

So I made a post about this like a week ago, and I did not get some helpful answers. I am trying to make an electron app using its tutorial and whenever I try to run the code using npm start, I get the following error:

npm ERR! missing script: start

And dont think that its just that I forgot to put "start": "electron ." because I already did that
Here is my file structure:

APP/ >node-modules index.html main.js package-lock.json package.json

Here is my package.json:

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

And my main.js:

const { app, BrowserWindow } = require('electron') // Create the window, don't rename the function! function createWindow () { // Create the browser window. const win = new BrowserWindow({ // Width and height of the window, feel free // to edit it. width: 800, height: 600, webPreferences: { nodeIntegration: true } }) // Load the index.html file of the app (we will create // it later) win.loadFile('index.html') } // Run the app when it's ready app.whenReady().then(createWindow)

What am I doing wrong?

Voters
Profile icon
tESTINGGMAIL
Profile icon
AnKitAwal
Profile icon
Squirrel777
Comments
hotnewtop
Profile icon
Coder100

npm run start?

Profile icon
Squirrel777

It did'nt work :( @Coder100

Profile icon
Squirrel777

nevermind I was using the wrong terminal lol @Coder100

Profile icon
Coder100
Profile icon
Coder100

yeah making sure you are in the right folder helps xd @Squirrel777