question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

init failed to install via NPM 5.x on Windows (EPERM)

See original GitHub issue
  • 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: Trying to create my first electron project (as given in the React + TypeScript sample) using a newly installed electon-forge failed to install babel modules. During a second attempt it failed to install react modules. During a third attempt it failed with the babel modules again.

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.

D:\Docs\Scripts\JS>electron-forge init test_1 --template=react-typescript
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 +1s
  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:\Docs\Scripts\JS\test_1 +0ms
  electron-forge:lifecycle Process Started: Initializing Project Directory +0ms
  electron-forge:init:directory creating directory: D:\Docs\Scripts\JS\test_1 +0ms
  electron-forge:init:directory found 7 files in the directory.  warning the user +5ms
  electron-forge:lifecycle Process Stopped: Initializing Project Directory +8ms
? WARNING: The specified path: "D:\Docs\Scripts\JS\test_1" is not empty, do you wish to continue? Yes
  electron-forge:lifecycle Process Succeeded: Initializing Project Directory +6s
  electron-forge:lifecycle Process Started: Initializing Git Repository +3ms
  electron-forge:init:git .git directory already exists, skipping git initialization +0ms
  electron-forge:lifecycle Process Succeeded: Initializing Git Repository +4ms
  electron-forge:lifecycle Process Started: Copying Starter Files +2ms
  electron-forge:init:starter-files creating directory: D:\Docs\Scripts\JS\test_1\src +0ms
  electron-forge:init:starter-files copying "D:\Apps\Roaming\npm\node_modules\electron-forge\tmpl\_gitignore" --> "D:\Docs\Scripts\JS\test_1\.gitignore" +2ms
  electron-forge:init:starter-files copying "D:\Apps\Roaming\npm\node_modules\electron-forge\tmpl\_compilerc" --> "D:\Docs\Scripts\JS\test_1\.compilerc" +14ms
  electron-forge:init:starter-files copying "D:\Apps\Roaming\npm\node_modules\electron-forge\tmpl\index.js" --> "D:\Docs\Scripts\JS\test_1\src\index.js" +5ms
  electron-forge:init:starter-files copying "D:\Apps\Roaming\npm\node_modules\electron-forge\tmpl\index.html" --> "D:\Docs\Scripts\JS\test_1\src\index.html" +4m
s
  electron-forge:lifecycle Process Succeeded: Copying Starter Files +33ms
  electron-forge:lifecycle Process Started: Initializing NPM Module +3ms
  electron-forge:init:npm writing package.json to: D:\Docs\Scripts\JS\test_1 +0ms
  electron-forge:lifecycle Process Succeeded: Initializing NPM Module +68ms
  electron-forge:lifecycle Process Started: Installing NPM Dependencies +1ms
  electron-forge:init:npm installing dependencies +6ms
  electron-forge:dependency-installer installing ["electron-compile","electron-squirrel-startup"] in: D:\Docs\Scripts\JS\test_1 dev=false,exact=false,withYarn=f
alse +0ms
  electron-forge:dependency-installer executing ["install","electron-compile","electron-squirrel-startup","--save"] in: D:\Docs\Scripts\JS\test_1 +4ms
  electron-forge:runtime-config fetching key verbose +0ms
  electron-forge:init:npm installing devDependencies +8s
  electron-forge:dependency-installer installing ["babel-preset-env","babel-preset-react","babel-plugin-transform-async-to-generator","electron-forge"] in: D:\D
ocs\Scripts\JS\test_1 dev=true,exact=false,withYarn=false +8s
  electron-forge:dependency-installer executing ["install","babel-preset-env","babel-preset-react","babel-plugin-transform-async-to-generator","electron-forge",
"--save-dev"] in: D:\Docs\Scripts\JS\test_1 +3ms
  electron-forge:runtime-config fetching key verbose +8s
  electron-forge:lifecycle Process Failed: Installing NPM Dependencies +44s

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 4294963248
Error: Failed to install modules: ["babel-preset-env","babel-preset-react","babel-plugin-transform-async-to-generator","electron-forge"]

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

What command line arguments are you passing?

init test_1 --template=react-typescript

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

"forge": {
    "make_targets": {
	"win32": [
	    "squirrel"
	],
	"darwin": [
	    "zip"
	],
	"linux": [
	    "deb",
	    "rpm"
	]
    },
    "electronPackagerConfig": {
	"packageManager": "npm"
    },
    "electronWinstallerConfig": {
	"name": "test_1"
    },
    "electronInstallerDebian": {},
    "electronInstallerRedhat": {},
    "github_repository": {
	"owner": "",
	"name": ""
    },
    "windowsStoreConfig": {
	"packageName": "",
	"name": "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. Run: electron-forge init test_1 --template=react-typescript

Environment Using latest versions of node (v8.2.1) and npm (5.5.1) in an up to date Windows 7 Pro.

N.B. npm install -g electron-forge had given serveral WARN deprecated warnings, and about skipping optional dependencies, but seemed to have installed OK, ending:

+ electron-forge@4.1.2
added 599 packages in 57.485s

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:25 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
ralph089commented, Nov 7, 2017

Same error as @mnemanja: Issue resolved with yarn.

1reaction
maleptcommented, Oct 23, 2017

The EPERM syscall scandir error appears to be https://github.com/npm/npm/issues/17747, which is not a Forge-specific error. We can’t do anything about that - the workarounds are to either use Yarn or an older version of NPM.

Read more comments on GitHub >

github_iconTop Results From Across the Web

init failed to install via NPM 5.x on Windows (EPERM) - GitHub
Please describe your issue: Trying to create my first electron project (as given in the React + TypeScript sample) using a newly installed...
Read more >
npm - EPERM: operation not permitted on Windows
I updated my node version to 8.9.4 and ran the necessary install command again from administrator command prompt. It ...
Read more >
Fixing intermittant 'EPERM: operation not permitted' on npm ...
npm install was failing the build intermittently when run by our build software Teamcity on a windows agent with ugly errors like: npm...
Read more >
NPM install error - Material Design for Bootstrap
Run command npm cache verify and then run npm i. You should fix it on the second point, but if the problem still...
Read more >
Error: EPERM: operation not permit… | Apple Developer Forums
I am installing packages for NODEJS/NPM and am receiving the following error, which, apparently, is not an error with the software, but with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found