gpt4 book ai didi

javascript - 我的JSON文件格式正确吗?

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

package.json:

{
"name": "password-generator",
"productName": "Password Generator",
"version": "1.0.0",
"description": "Password generator desktop app",
"main": "main.js",
"scripts": {
"start": "electron ."
"build-installer": "electron-builder"
},
"build": {
"appId": "password-generator",
},
"win": {
"target": ["nsis"],
"icon": "/icon.png",
},
"nsis": {
"installerIcon": "/icon.png",
"uninstallerIcon": "/icon.png",
"uninstallDisplayName": "Password Generator",
"oneClick": false,
"allowToChangeInstallationDirectory": true,
},
"author": "JipBit",
"license": "ISC",
"devDependencies": {
"electron-forge": "^5.2.4",
},
"dependencies": {
"electron-builder": "^22.7.0",
},
}
错误:
npm ERR! code EJSONPARSE
npm ERR! file C:\Users\mel\Desktop\Password Generator\package.json
npm ERR! JSON.parse Failed to parse json
npm ERR! JSON.parse Unexpected string in JSON at position 212 while parsing '{
npm ERR! JSON.parse "name": "password-generator",
npm ERR! JSON.parse "pro'
npm ERR! JSON.parse Failed to parse package.json data.
npm ERR! JSON.parse package.json must be actual JSON, not just JavaScript.
信息:尝试运行npm start和npm run build-installer时,出现关于package.json文件的错误。在设置运行构建安装程序以使我的 Electron 应用程序可执行时,将其添加到package.json后,出现了此错误。
编辑新错误:
'electron' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! password-generator@1.0.0 start: `electron .`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the password-generator@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

最佳答案

最初查看它时,您需要在第8行的后面加上一个',':

"start": "electron ."
编辑:
尝试此操作,只有几个放错位置的逗号:
{
"name": "password-generator",
"productName": "Password Generator",
"version": "1.0.0",
"description": "Password generator desktop app",
"main": "main.js",
"scripts": {
"start": "electron .",
"build-installer": "electron-builder"
},
"build": {
"appId": "password-generator"
},
"win": {
"target": ["nsis"],
"icon": "/icon.png"
},
"nsis": {
"installerIcon": "/icon.png",
"uninstallerIcon": "/icon.png",
"uninstallDisplayName": "Password Generator",
"oneClick": false,
"allowToChangeInstallationDirectory": true
},
"author": "JipBit",
"license": "ISC",
"devDependencies": {
"electron-forge": "^5.2.4"
},
"dependencies": {
"electron-builder": "^22.7.0"
}
}

关于javascript - 我的JSON文件格式正确吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62867645/

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