Skip to content

NPM install -g failed execution of postinstall-xxxxxx.cmd #5474

Closed
@PlanBernhard

Description

@PlanBernhard

Issue

npm install -g electron results in this error

npm ERR! code 1
npm ERR! path C:\data\dev\dy\we\quick-start\node_modules\electron
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c C:\Users\X\AppData\Local\Temp\postinstall-a836babe.cmd
npm ERR! Blocked by group policy. Please contact your system administrator (translated).
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\X\AppData\Local\npm-cache\_logs\2022-09-06T09_22_56_569Z-debug-0.log

Our company policies blocking the execution of cmd files from the appdata folder. Other modules like electron-cli did also fail with the same error message.

Tried solutions

Overrule the installation path by adding

prefix = 'C:\data\dev\npm-global'

into C:\Users\X\.npmrc file, but the error persits.
And installed NodeJS to C:\data\dev\NodeJS but this does still not solve the problem.

Questions

  1. What does postinstall-xxxxx.cmd ?
  2. Is it possible to configure a different location for postinstall-xxxxx.cmd?

EDIT 1

Ok, my bad. I just tried to install expressjs and had no such error. It seems like a problem related to electron, but I am not sure, because I don't work with NodeJS normally. If I am correct, please give me some feedback and I will close this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions