Youcef LAIDANI
Youcef LAIDANI

Reputation: 59978

missing script: start Electron

I try to create my first angular application using Electron, so i follow this guide here :

Electron Documentation

so i do step by step what is in the guide but when i do this command :

npm start

I get this error here:

$ npm start
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v6.9.4
npm ERR! npm  v3.10.10

npm ERR! missing script: start
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     D:\FreeLancer\angular2electron\npm-debug.log

package.json

{
  "name": "angular2electron",
  "version": "1.0.1",
  "description": "my first angularjs",
  "main": "main.js",
  "dependencies": {
    "electron": "^1.4.13"
  },
  "devDependencies": {},
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "LAIDANI Youcef",
  "license": "MIT"
}

Someone have an idea about this problem?

Thank you.

Upvotes: 6

Views: 15167

Answers (1)

corn3lius
corn3lius

Reputation: 4985

npm start runs the script in the package.json. To get an electron app running with it just add electron . to the start script :

package.json

{
 "name": "angular2electron",
  "version": "1.0.1",
  "description": "my first angularjs",
  "main": "main.js",
  "dependencies": {
    "electron": "^1.4.13"
  },
  "devDependencies": {},
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1", 
    "start" : "electron ."
  },
  "author": "LAIDANI Youcef",
  "license": "MIT"
}

Upvotes: 15

Related Questions