简体   繁体   中英

Why I have an error with Ganache on npm start in WSL?

I'm trying to run Ganache in WSL (Ubuntu). When I clone git repository, npm install and then run npm start , I get this error which is not specified.

> ganache@2.0.0-beta.1 start /mnt/c/Users/Name/Documents/ethereum_projects/Ganache/ganache
> electron-forge start

✔ Checking your system
✔ Locating Application
✔ Preparing native dependencies: 15 / 15
✔ Launching Application
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ganache@2.0.0-beta.1 start: `electron-forge start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ganache@2.0.0-beta.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/name/.npm/_logs/2018-12-25T22_53_48_231Z-debug.log

In the log file is nothing more specific. Here is it:

10 silly lifecycle ganache@2.0.0-beta.1~start: Args: [ '-c', 'electron-forge start' ]
11 silly lifecycle ganache@2.0.0-beta.1~start: Returned: code: 1  signal: null
12 info lifecycle ganache@2.0.0-beta.1~start: Failed to exec start script
13 verbose stack Error: ganache@2.0.0-beta.1 start: `electron-forge start`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack     at EventEmitter.emit (events.js:182:13)
13 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:182:13)
13 verbose stack     at maybeClose (internal/child_process.js:962:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
14 verbose pkgid ganache@2.0.0-beta.1
15 verbose cwd /mnt/c/Users/Name/Documents/ethereum_projects/Ganache/ganache
16 verbose Linux 4.4.0-17763-Microsoft
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "start"
18 verbose node v10.14.2
19 verbose npm  v6.4.1
20 error code ELIFECYCLE
21 error errno 1
22 error ganache@2.0.0-beta.1 start: `electron-forge start`
22 error Exit status 1
23 error Failed at the ganache@2.0.0-beta.1 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

and here is my package.json:

{
  "name": "ganache",
  "productName": "Ganache",
  "version": "2.0.0-beta.1",
  "description": "Personal Blockchain for Ethereum",
  "main": "./src/init.js",
  "private": true,
  "scripts": {
    "start": "electron-forge start",
    "lint": "echo \"No linting configured\"",
    "sign-mac": "codesign --deep --force --verbose --sign 'Developer ID Application: Timothy Coulter (58RKXWC272)' ./dist/*.dmg",
    "makeappxassets": "svg2uwptiles -i ./Logo.svg -c ./blank.svg -o ./resources/appx/",
    "build-linux": "cd ./node_modules/rabin-bindings && node-gyp rebuild && cd ../../ && electron-builder --linux",
    "build-mac": "electron-builder --mac",
    "build-windows": "electron-builder --win",
    "test": "npm run test-mocha",
    "test-mocha": "mocha --compilers js:babel-register --check-leaks --globals _scratch,sanitizedData 'test/mocha/**/*.test.js'"
  },
  "browserslist": "chrome 50",
  "build": {
    "appId": "org.trufflesuite.ganache",
    "files": [
      "src/**/*",
      "node_modules/**/*",
      "resources/fonts/*",
      "resources/icons/**/*",
      "package.json"
    ],
    "directories": {
      "buildResources": "resources",
      "output": "dist"
    },
    "win": {
      "icon": "resources/icons/win/icon.ico",
      "certificateFile": "./certs/cert.pfx",
      "target": [
        {
          "target": "nsis",
          "arch": [
            "x64"
          ]
        },
        {
          "target": "appx",
          "arch": [
            "x64"
          ]
        }
      ]
    },
    "appx": {
      "identityName": "Ganache",
      "publisher": "CN=Consensys Inc, O=Consensys Inc, L=New York, S=New York, C=US",
      "publisherDisplayName": "Consensys Inc",
      "backgroundColor": "#34262A"
    },
    "nsis": {
      "oneClick": false,
      "allowToChangeInstallationDirectory": "true",
      "deleteAppDataOnUninstall": "true",
      "artifactName": "Ganache-${version}-setup.${ext}"
    },
    "mac": {
      "icon": "resources/icons/icon.icns",
      "identity": "Timothy Coulter (58RKXWC272)"
    },
    "dmg": {
      "background": "resources/dmg/background.tiff",
      "contents": [
        {
          "x": 219,
          "y": 358,
          "type": "dir",
          "name": "Ganache.app"
        },
        {
          "x": 439,
          "y": 358,
          "type": "link",
          "name": "Applications",
          "path": "/Applications"
        }
      ],
      "icon": "resources/icons/icon.icns",
      "format": "ULFO"
    },
    "linux": {
      "target": [
        {
          "target": "AppImage",
          "arch": [
            "x64"
          ]
        }
      ],
      "icon": "resources/icons/png/",
      "category": "Development",
      "executableName": "Ganache",
      "artifactName": "Ganache-${version}.${ext}"
    }
  },
  "config": {
    "forge": {
      "electronPackagerConfig": {
        "icon": "resources/icons/win/icon.ico",
        "prune": true,
        "ignore": [
          ".*node_modules/fsevents/build.*",
          "forge_hooks",
          ".vscode"
        ],
        "afterPrune": [
          "./forge_hooks/afterPrune.js"
        ]
      }
    }
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/trufflesuite/ganache.git"
  },
  "author": {
    "name": "Truffle",
    "email": "inquiry@trufflesuite.com",
    "url": "https://github.com/trufflesuite"
  },
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/trufflesuite/ganache/issues"
  },
  "keywords": [
    "ganache",
    "ethereum",
    "blockchain",
    "truffle"
  ],
  "homepage": "https://github.com/trufflesuite/ganache#readme",
  "devDependencies": {
    "asar": "^0.13.0",
    "babel-core": "^6.21.0",
    "babel-eslint": "^7.1.1",
    "babel-plugin-add-module-exports": "^0.2.1",
    "babel-plugin-dev-expression": "^0.2.1",
    "babel-plugin-inline-react-svg": "^0.5.2",
    "babel-plugin-transform-async-to-generator": "^6.24.1",
    "babel-plugin-transform-class-properties": "^6.19.0",
    "babel-plugin-transform-es2015-classes": "^6.18.0",
    "babel-polyfill": "^6.20.0",
    "babel-preset-env": "^1.6.1",
    "babel-preset-react": "^6.24.1",
    "babel-preset-react-hmre": "^1.1.1",
    "babel-preset-react-optimize": "^1.0.1",
    "babel-preset-stage-0": "^6.16.0",
    "chai": "^3.5.0",
    "concurrently": "^3.1.0",
    "cross-env": "^3.1.4",
    "electron-builder": "20.31.2",
    "electron-compilers": "^5.9.0",
    "electron-debug": "^1.1.0",
    "electron-devtools-installer": "^2.0.1",
    "electron-forge": "^5.1.1",
    "electron-icon-maker": "0.0.3",
    "electron-log": "^2.2.9",
    "electron-prebuilt-compile": "1.8.4",
    "jsdom": "^9.9.1",
    "minimist": "^1.2.0",
    "mocha": "^3.5.3",
    "node-sass": "^4.5.3",
    "prop-types": "^15.5.10",
    "rcedit": "^0.9.0",
    "redux-logger": "^2.7.4",
    "source-map-support": "^0.4.8",
    "svg2uwptiles": "0.0.4",
    "temp": "^0.8.3",
    "webpack": "^3.11.0"
  },
  "dependencies": {
    "@exponent/electron-cookies": "^2.0.0",
    "@seesemichaelj/react-json-view": "^1.20.2",
    "async": "^2.5.0",
    "benjamincburns-forked-electron-updater": "2.21.6",
    "builder-util-runtime": "^4.2.0",
    "electron-compile": "^6.4.2",
    "electron-settings": "^3.1.2",
    "electron-squirrel-startup": "^1.0.0",
    "ethagen": "0.0.2",
    "ethereumjs-units": "^0.2.0",
    "filesize": "^3.6.1",
    "find-process": "^1.1.0",
    "fs-extra": "^7.0.0",
    "ganache-core": "2.3.2",
    "keccak": "^1.4.0",
    "lodash.clonedeep": "^4.5.0",
    "lodash.isequal": "^4.5.0",
    "lodash.merge": "^4.6.1",
    "lodash.omit": "^4.5.0",
    "lodash.padstart": "^4.6.1",
    "moment": "^2.17.1",
    "moment-timezone": "^0.5.11",
    "moniker": "^0.1.2",
    "mousetrap": "^1.6.1",
    "node-localstorage": "^1.3.1",
    "pidusage": "^1.1.5",
    "pluralize": "^5.0.0",
    "rabin-bindings": "^1.7.4",
    "react": "^16.3.2",
    "react-custom-scrollbars": "^4.2.1",
    "react-dom": "^16.3.2",
    "react-hot-loader": "^3.1.1",
    "react-marked-markdown": "^1.4.6",
    "react-md-spinner": "^0.3.0",
    "react-moment": "^0.2.2",
    "react-redux": "^5.0.2",
    "react-render-html": "^0.6.0",
    "react-router": "^3.0.1",
    "react-router-redux": "^4.0.7",
    "redux": "^3.6.0",
    "redux-thunk": "^2.2.0",
    "reselect": "^2.5.4",
    "rlp": "^2.1.0",
    "scrypt": "^6.0.3",
    "truffle-config": "^1.1.0-next.1",
    "truffle-decoder": "^1.0.1-beta.0",
    "universal-analytics": "^0.4.13",
    "uuid": "^3.1.0",
    "web3": "1.0.0-beta.35"
  },
  "optionalDependencies": {
    "7zip-bin-win": "^2.2.0",
    "dmg-builder": "^5.3.0"
  },
  "devEngines": {
    "node": ">=6.x",
    "npm": ">=3.x"
  }
}

fdfsfasdfafdfsfasdfafdfsfasdfafdfsfasdfafdfsfasdfafdfsfasdfafdfsfasdfafdfsfasdfafdfsfasdfafdfsfasdfafdfsfasdfafdfsfasdfafdfsfasdfafdfsfasdfa fdfsfasdfa

I cloned Ganache and followed all the instructions on the Readme.md file, everything went fine for me. I am using:

  • Node : v9.11.1
  • npm : 6.4.1

I will suggest you delete your node_modules then you should carefully go through the instructions and also ensure you're following their basic requirements:

  • npm v5.3.0
  • node v8.3.0

After which you can then go ahead and do these:

npm install
npm start

NOTE : Ensure that all your dependencies are successfully installed when you run npm install

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM