Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

electron-forge init produce error on trying to copy a file via yarn #356

Closed
3 tasks done
ChristianG1984 opened this issue Oct 25, 2017 · 5 comments
Closed
3 tasks done
Labels
blocked/upstream Issues blocked by upstream bugs

Comments

@ChristianG1984
Copy link

ChristianG1984 commented Oct 25, 2017

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project follows, as appropriate.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.

Please describe your issue:

When I run the command electron-forge init --template=angular2, I get an error, that some modules could not be installed.
My environment is a Windows 10 PC with the latest Update (Creators Fall).

Console output when you run electron-forge with the environment variable DEBUG=electron-forge:*. (Instructions on how to do so here). Please include the stack trace if one exists.

WARNING: DEBUG environment variable detected.  Progress indicators will be sent over electron-forge:lifecycle
  electron-forge:lifecycle Process Started: Checking your system +0ms
  electron-forge:lifecycle Process Succeeded: Checking your system +813ms
  electron-forge:runtime-config setting key: verbose to value: false +0ms
WARNING: DEBUG environment variable detected.  Progress indicators will be sent over electron-forge:lifecycle
  electron-forge:init Initializing in: D:\Tests\electron_test_1 +0ms
  electron-forge:lifecycle Process Started: Initializing Project Directory +0ms
  electron-forge:init:directory creating directory: D:\Tests\electron_test_1 +0ms
  electron-forge:lifecycle Process Succeeded: Initializing Project Directory +69ms
  electron-forge:lifecycle Process Started: Initializing Git Repository +2ms
  electron-forge:init:git executing "git init" in directory: D:\Tests\electron_test_1 +0ms
  electron-forge:lifecycle Process Succeeded: Initializing Git Repository +240ms
  electron-forge:lifecycle Process Started: Copying Starter Files +0ms
  electron-forge:init:starter-files creating directory: D:\Tests\electron_test_1\src +0ms
  electron-forge:init:starter-files copying "C:\Users\cgo.ifu\AppData\Roaming\npm\node_modules\electron-forge\tmpl\_gitignore" --> "D:\Tests\electron_test_1\.gitignore" +0ms
  electron-forge:init:starter-files copying "C:\Users\cgo.ifu\AppData\Roaming\npm\node_modules\electron-forge\tmpl\_compilerc" --> "D:\Tests\electron_test_1\.compilerc" +16ms
  electron-forge:init:starter-files copying "C:\Users\cgo.ifu\AppData\Roaming\npm\node_modules\electron-forge\tmpl\index.js" --> "D:\Tests\electron_test_1\src\index.js" +0ms
  electron-forge:init:starter-files copying "C:\Users\cgo.ifu\AppData\Roaming\npm\node_modules\electron-forge\tmpl\index.html" --> "D:\Tests\electron_test_1\src\index.html" +33ms
  electron-forge:lifecycle Process Succeeded: Copying Starter Files +51ms
  electron-forge:lifecycle Process Started: Initializing NPM Module +1ms
  electron-forge:init:npm writing package.json to: D:\Tests\electron_test_1 +0ms
  electron-forge:lifecycle Process Succeeded: Initializing NPM Module +434ms
  electron-forge:lifecycle Process Started: Installing NPM Dependencies +0ms
  electron-forge:init:npm installing dependencies +0ms
  electron-forge:dependency-installer installing ["electron-compile","electron-squirrel-startup"] in: D:\Tests\electron_test_1 dev=false,exact=false,withYarn=true +0ms
  electron-forge:dependency-installer executing ["add","electron-compile","electron-squirrel-startup"] in: D:\Tests\electron_test_1 +0ms
  electron-forge:runtime-config fetching key verbose +0ms
  electron-forge:init:npm installing devDependencies +22s
  electron-forge:dependency-installer installing ["babel-preset-env","babel-preset-react","babel-plugin-transform-async-to-generator","electron-forge"] in: D:\Tests\electron_test_1 dev=true,exact=false,withYarn=true
+22s
  electron-forge:dependency-installer executing ["add","babel-preset-env","babel-preset-react","babel-plugin-transform-async-to-generator","electron-forge","--dev"] in: D:\Tests\electron_test_1 +0ms
  electron-forge:runtime-config fetching key verbose +22s
  electron-forge:lifecycle Process Failed: Installing NPM Dependencies +1m

An unhandled error has occurred inside Forge:
Failed to install modules: ["babel-preset-env","babel-preset-react","babel-plugin-transform-async-to-generator","electron-forge"]

With output: Exited with status 1
Error: Failed to install modules: ["babel-preset-env","babel-preset-react","babel-plugin-transform-async-to-generator","electron-forge"]

With output: Exited with status 1
    at _callee$ (C:\Users\cgo.ifu\AppData\Roaming\npm\node_modules\electron-forge\dist\util\install-dependencies.js:81:19)
    at tryCatch (C:\Users\cgo.ifu\AppData\Roaming\npm\node_modules\electron-forge\node_modules\regenerator-runtime\runtime.js:65:40)
    at Generator.invoke [as _invoke] (C:\Users\cgo.ifu\AppData\Roaming\npm\node_modules\electron-forge\node_modules\regenerator-runtime\runtime.js:299:22)
    at Generator.prototype.(anonymous function) [as throw] (C:\Users\cgo.ifu\AppData\Roaming\npm\node_modules\electron-forge\node_modules\regenerator-runtime\runtime.js:117:21)
    at Generator.tryCatcher (C:\Users\cgo.ifu\AppData\Roaming\npm\node_modules\electron-forge\node_modules\bluebird\js\release\util.js:16:23)
    at PromiseSpawn._promiseRejected (C:\Users\cgo.ifu\AppData\Roaming\npm\node_modules\electron-forge\node_modules\bluebird\js\release\generators.js:107:10)
    at Promise._settlePromise (C:\Users\cgo.ifu\AppData\Roaming\npm\node_modules\electron-forge\node_modules\bluebird\js\release\promise.js:576:26)
    at Promise._settlePromise0 (C:\Users\cgo.ifu\AppData\Roaming\npm\node_modules\electron-forge\node_modules\bluebird\js\release\promise.js:614:10)
    at Promise._settlePromises (C:\Users\cgo.ifu\AppData\Roaming\npm\node_modules\electron-forge\node_modules\bluebird\js\release\promise.js:689:18)
    at Async._drainQueue (C:\Users\cgo.ifu\AppData\Roaming\npm\node_modules\electron-forge\node_modules\bluebird\js\release\async.js:133:16)
    at Async._drainQueues (C:\Users\cgo.ifu\AppData\Roaming\npm\node_modules\electron-forge\node_modules\bluebird\js\release\async.js:143:10)
    at Immediate.Async.drainQueues (C:\Users\cgo.ifu\AppData\Roaming\npm\node_modules\electron-forge\node_modules\bluebird\js\release\async.js:17:14)
    at runCallback (timers.js:785:20)
    at tryOnImmediate (timers.js:747:5)
    at processImmediate [as _immediateCallback] (timers.js:718:5)

What command line arguments are you passing?

electron-forge init --template=angular2

What does your config.forge data in package.json look like?

"config": {
        "forge": {
            "make_targets": {
                "win32": [
                    "squirrel"
                ],
                "darwin": [
                    "zip"
                ],
                "linux": [
                    "deb",
                    "rpm"
                ]
            },
            "electronPackagerConfig": {
                "packageManager": "yarn"
            },
            "electronWinstallerConfig": {
                "name": "electron_test_1"
            },
            "electronInstallerDebian": {},
            "electronInstallerRedhat": {},
            "github_repository": {
                "owner": "",
                "name": ""
            },
            "windowsStoreConfig": {
                "packageName": "",
                "name": "electron_test_1"
            }
        }
    }

Please provide either a failing minimal testcase (with a link to the code) or detailed steps to
reproduce your problem. Using electron-forge init is a good starting point, if that is not the
source of your problem.

To get more into the detail, the last interesting bit of the yarn-error.log is this:

Trace: 
  Error: ENOENT: no such file or directory, copyfile 'C:\Users\cgo.ifu\AppData\Local\Yarn\cache\v1\npm-ajv-5.3.0-4414ff74a50879c208ee5fdc826e32c303549eda\dist\ajv.bundle.js' -> 'D:\Tests\electron_test_1\node_modules\ajv\dist\ajv.bundle.js'

But the missing file is there, when I check this out. And it's nearly everytime another file, which could not be copied. For me, it seems, that one process is too fast or the underlying file system is too slow, so that they are running into a conflict. (But should it not be so, that one has to wait for the other?)

Without erasing anything, I run the command again, until it completes successfully. (That will happen, but it's not predictable, when.) While these trials, the yarn-error.log updates and shows me everytime another file, which could not be copied.

(The story is not over, but that may be better put as another Issue, because it's about electron-forge start. But it may be related to this Issue. EDIT: It continues here: #357)

@malept
Copy link
Member

malept commented Oct 25, 2017

What version of yarn is this? Have you tried different versions of yarn?

@malept
Copy link
Member

malept commented Oct 25, 2017

I wonder what happens if you delete the Yarn cache.

@malept malept changed the title electron-forge init produce error on trying to copy a file electron-forge init produce error on trying to copy a file via yarn Oct 25, 2017
@ChristianG1984
Copy link
Author

ChristianG1984 commented Oct 26, 2017

The version of yarn is 1.2.1
I tried to clean the yarn cache. This time, when I ran the electron-forge init --template=angular2 command, the error raised much later, while he was Installing Template Dependencies.

An unhandled error has occurred inside Forge:
Failed to install modules: ["tslint@^4.2.0","typescript@~2.1.4"]

With output: Exited with status 1
Error: Failed to install modules: ["tslint@^4.2.0","typescript@~2.1.4"]

With output: Exited with status 1
    at _callee$ (C:\Users\cgo.ifu\AppData\Roaming\npm\node_modules\electron-forge\dist\util\install-dependencies.js:81:19)
    at tryCatch (C:\Users\cgo.ifu\AppData\Roaming\npm\node_modules\electron-forge\node_modules\regenerator-runtime\runtime.js:65:40)
    at Generator.invoke [as _invoke] (C:\Users\cgo.ifu\AppData\Roaming\npm\node_modules\electron-forge\node_modules\regenerator-runtime\runtime.js:299:22)
    at Generator.prototype.(anonymous function) [as throw] (C:\Users\cgo.ifu\AppData\Roaming\npm\node_modules\electron-forge\node_modules\regenerator-runtime\runtime.js:117:21)
    at Generator.tryCatcher (C:\Users\cgo.ifu\AppData\Roaming\npm\node_modules\electron-forge\node_modules\bluebird\js\release\util.js:16:23)
    at PromiseSpawn._promiseRejected (C:\Users\cgo.ifu\AppData\Roaming\npm\node_modules\electron-forge\node_modules\bluebird\js\release\generators.js:107:10)
    at Promise._settlePromise (C:\Users\cgo.ifu\AppData\Roaming\npm\node_modules\electron-forge\node_modules\bluebird\js\release\promise.js:576:26)
    at Promise._settlePromise0 (C:\Users\cgo.ifu\AppData\Roaming\npm\node_modules\electron-forge\node_modules\bluebird\js\release\promise.js:614:10)
    at Promise._settlePromises (C:\Users\cgo.ifu\AppData\Roaming\npm\node_modules\electron-forge\node_modules\bluebird\js\release\promise.js:689:18)
    at Async._drainQueue (C:\Users\cgo.ifu\AppData\Roaming\npm\node_modules\electron-forge\node_modules\bluebird\js\release\async.js:133:16)
    at Async._drainQueues (C:\Users\cgo.ifu\AppData\Roaming\npm\node_modules\electron-forge\node_modules\bluebird\js\release\async.js:143:10)
    at Immediate.Async.drainQueues (C:\Users\cgo.ifu\AppData\Roaming\npm\node_modules\electron-forge\node_modules\bluebird\js\release\async.js:17:14)
    at runCallback (timers.js:785:20)
    at tryOnImmediate (timers.js:747:5)
    at processImmediate [as _immediateCallback] (timers.js:718:5)

The yarn-error.log is this time a bit different:

Trace: 
  Error: ENOTEMPTY: directory not empty, rmdir 'D:\Tests\electron_test_1\node_modules\.staging\electron-forge-85fdc800'

@malept
Copy link
Member

malept commented Oct 26, 2017

Can you try older versions of yarn?

@malept malept added the blocked/upstream Issues blocked by upstream bugs label Nov 22, 2017
@MarshallOfSound
Copy link
Member

This is an upstream yarn issue that I assume has been fixed now (yarn has been stable on my machine for a few months now 👍 )

dsanders11 pushed a commit that referenced this issue Jan 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked/upstream Issues blocked by upstream bugs
Projects
None yet
Development

No branches or pull requests

3 participants