Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 619
YCF_L Avatar asked Jan 06 '17 17:01

YCF_L


1 Answers

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"
}
like image 101
corn3lius Avatar answered Nov 15 '22 05:11

corn3lius