【问题标题】:missing script: start Electron缺少脚本:启动 Electron
【发布时间】:2017-05-21 12:48:31
【问题描述】:

我尝试使用 Electron 创建我的第一个 Angular 应用程序,因此我在此处遵循本指南:

Electron Documentation

所以我一步一步地做指南中的内容,但是当我执行此命令时:

npm start

我在这里收到此错误:

$ 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"
}

有人知道这个问题吗?

谢谢。

【问题讨论】:

  • 你的package.json是什么样的?
  • @corn3lius 我编辑我的问题,你可以查看我的package.json
  • npm test 将运行scipts.test 中的命令。 npm start 将运行您在 scripts.start 中输入的命令
  • 电子快速启动github.com/electron/electron-quick-start/blob/master/…的启动脚本为electron .
  • 哦,效果很好,非常感谢@corn3lius :)

标签: angularjs npm electron


【解决方案1】:

npm start 运行 package.json 中的脚本。要运行一个电子应用程序,只需将electron . 添加到启动脚本:

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"
}

【讨论】:

    猜你喜欢
    • 2019-04-13
    • 2019-05-16
    • 2022-01-11
    • 2018-11-30
    • 1970-01-01
    • 2019-09-09
    • 2021-10-23
    • 1970-01-01
    • 2020-06-30
    相关资源
    最近更新 更多