web-dev-qa-db-ja.com

'build'は内部または外部コマンドとして認識されません-ElectronJS / electron-builderの使用

私は最近、electronJSアプリをelectron-builderとともにより高いバージョンに更新しました。 「npm start」でアプリを実行しても問題はありませんが、electron-builderを使用してアプリをビルドしようとすると、「npm run dist」を実行すると次のエラーが発生します。

$ npm run dist

[email protected] dist C:\ Projects\myapp build

「ビルド」は、内部または外部コマンド、操作可能なプログラムまたはバッチファイルとして認識されません。 npm ERR!コードELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] dist:build npm ERR!終了ステータス1 npm ERR! npm ERR! [email protected] distスクリプトで失敗しました。 npm ERR!これはおそらくnpmの問題ではありません。上記の追加のログ出力がある可能性があります。

npm ERR!この実行の完全なログは、npm ERR!
C:\ Users\User\AppData\Roaming\npm-cache_logs\2019-12-05T11_35_33_988Z-debug.log

package.json:

{
  "name": "myapp",
  "version": "1.1.0",
  "description": "none",
  "main": "main.js",
  "scripts": {
    "start": "electron .",
    "dist": "build",
    "postinstall": "electron-builder install-app-deps"
  },
  "build": {
    "appId": "Myapp.com",
    "asar": true,
    "asarUnpack": [
      "configuration/**/*",
      "output/**/*",
      "appdata/**/*",
      "node_modules/easy-pdf-merge/**/*"
    ]
  },
  "repository": {
    "type": "git",
    "url": ""
  },
  "author": "",
  "license": "ISC",
  "homepage": "",
  "dependencies": {
    "axios": "^0.19.0",
    "cryptr": "^6.0.1",
    "easy-pdf-merge": "^0.2.0",
    "edit-json-file": "^1.2.0",
    "electron-log": "^3.0.9",
    "electron-updater": "^4.2.0",
    "eslint": "^5.12.0",
    "exceljs": "^1.6.3",
    "googleapis": "^27.0.0",
    "mustache": "^3.0.1",
    "node-localstorage": "^2.1.5",
    "npm": "^6.5.0",
    "pdf-table-extractor": "^1.0.3",
    "popper.js": "^1.15.0",
    "sqlite3": "^4.0.4",
    "tippy.js": "^4.3.4",
    "universal-analytics": "^0.4.20",
    "uuid": "^3.3.3",
    "webpack": "^4.28.0",
    "winston": "^3.1.0"
  },
  "devDependencies": {
    "electron": "^7.1.3",
    "electron-builder": "^21.2.0"
  }
}

ノードのバージョン:12.13.1 npmバージョン:6.12.1

2
user1725266

更新後、package.jsonで以下を逃しました:

"scripts": {
  "pack": "electron-builder --dir",
  "dist": "electron-builder"
}

これによると: https://www.npmjs.com/package/electron-builder

4
user1725266