gpt4 book ai didi

angularjs - 缺少脚本 : start Electron

转载 作者:行者123 更新时间:2023-12-03 12:19:55 25 4
gpt4 key购买 nike

我尝试使用 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"
}

有人对这个问题有想法吗?

谢谢你。

最佳答案

npm start运行 package.json 中的脚本。要使用它运行 Electron 应用程序,只需添加 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"
}

关于angularjs - 缺少脚本 : start Electron,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41511079/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com