使用带有电子编译和电子松鼠启动功能的电子伪造初始化电子App时出现错误

时间:2018-10-25 05:29:21

标签: node.js npm electron electron-forge

我通过使用GitHub按需培训开始了电子学习。当我执行以下命令时。系统抛出错误。

electron % electron-forge init electron-app
⚠ Could not check Yarn version "0.32
", assuming incompatible
⚠ You are using Yarn, but not a known good version.
The known versions that work with Electron Forge are: 0.23.3 || 0.24.6 || >= 1.0.0 || 0.27.5
✔ Checking your system
? WARNING: The specified path: "/home/anoobbava/electron/electron-app" is not empty, do you wish to continue? Yes
✔ Initializing Project Directory
✔ Initializing Git Repository
✔ Copying Starter Files
✔ Initializing NPM Module
✖ Installing NPM Dependencies

An unhandled error has occurred inside Forge:
Failed to install modules: ["electron-compile","electron-squirrel-startup"]

With output: Exited with status 1
Error: Failed to install modules: ["electron-compile","electron-squirrel-startup"]

With output: Exited with status 1
    at /home/anoobbava/.nvm/versions/node/v9.9.0/lib/node_modules/electron-forge/dist/util/install-dependencies.js:55:13
    at Generator.throw (<anonymous>)
    at Generator.tryCatcher (/home/anoobbava/.nvm/versions/node/v9.9.0/lib/node_modules/electron-forge/node_modules/bluebird/js/release/util.js:16:23)
    at PromiseSpawn._promiseRejected (/home/anoobbava/.nvm/versions/node/v9.9.0/lib/node_modules/electron-forge/node_modules/bluebird/js/release/generators.js:107:10)
    at Promise._settlePromise (/home/anoobbava/.nvm/versions/node/v9.9.0/lib/node_modules/electron-forge/node_modules/bluebird/js/release/promise.js:576:26)
    at Promise._settlePromise0 (/home/anoobbava/.nvm/versions/node/v9.9.0/lib/node_modules/electron-forge/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/home/anoobbava/.nvm/versions/node/v9.9.0/lib/node_modules/electron-forge/node_modules/bluebird/js/release/promise.js:690:18)
    at _drainQueueStep (/home/anoobbava/.nvm/versions/node/v9.9.0/lib/node_modules/electron-forge/node_modules/bluebird/js/release/async.js:138:12)
    at _drainQueue (/home/anoobbava/.nvm/versions/node/v9.9.0/lib/node_modules/electron-forge/node_modules/bluebird/js/release/async.js:131:9)
    at Async._drainQueues (/home/anoobbava/.nvm/versions/node/v9.9.0/lib/node_modules/electron-forge/node_modules/bluebird/js/release/async.js:147:5)
    at Immediate.Async.drainQueues [as _onImmediate] (/home/anoobbava/.nvm/versions/node/v9.9.0/lib/node_modules/electron-forge/node_modules/bluebird/js/release/async.js:17:14)
    at runCallback (timers.js:763:18)
    at tryOnImmediate (timers.js:734:5)
    at processImmediate (timers.js:716:5)

其他详细信息如下, 操作系统:Ubuntu 18.04 节点:v9.9.0 NPM:6.4.1 我已经更新了NPM版本,但是问题仍然存在。另外,在这种情况下是否需要安装纱线。

1 个答案:

答案 0 :(得分:2)

我有一个类似的问题,最终与纱线版本有关。我通过以下方式安装yarn来修复它:

sudo npm install --global yarn