2

当我使用 安装 Electronnpm install electron-prebuilt --save-dev时,出现以下错误:

 Error: end of central directory record signature not found
     at C:\Users\madhava\Desktop\New folder\node_modules\electron-prebuilt\node_modules\extract-zip\node_modules\yauzl\index.js:98:14
     at C:\Users\madhava\Desktop\New folder\node_modules\electron-prebuilt\node_modules\extract-zip\node_modules\yauzl\index.js:342:5
     at C:\Users\madhava\Desktop\New folder\node_modules\electron-prebuilt\node_modules\extract-zip\node_modules\yauzl\node_modules\fd-slicer\index.js:32:7
     at FSReqWrap.wrapper [as oncomplete] (fs.js:527:17)
 npm ERR! Windows_NT 6.1.7600
 npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs
 \\node_modules\\npm\\bin\\npm-cli.js" "install" "electron-prebuilt" "--save-dev"

 npm ERR! node v0.12.4
 npm ERR! npm  v2.10.1
 npm ERR! code ELIFECYCLE

 npm ERR! electron-prebuilt@0.27.3 postinstall: `node install.js`
 npm ERR! Exit status 1
 npm ERR!
 npm ERR! Failed at the electron-prebuilt@0.27.3 postinstall script 'node install
 .js'.
 npm ERR! This is most likely a problem with the electron-prebuilt package,
 npm ERR! not with npm itself.
 npm ERR! Tell the author that this fails on your system:
 npm ERR!     node install.js
 npm ERR! You can get their info via:
 npm ERR!     npm owner ls electron-prebuilt
 npm ERR! There is likely additional logging output above.

 npm ERR! Please include the following file with any support request:
 npm ERR!     C:\Users\madhava\Desktop\New folder\npm-debug.log
4

3 回答 3

4

尝试在不可靠的连接上安装时遇到了这个问题,这意味着我留下了一些坏拉链。解决方案是(至少在 OSX 上删除~/.electron文件夹,然后npm install electron-prebuilt再次运行。但不确定压缩文件在 Windows 上的保存位置。

于 2015-08-10T08:09:35.730 回答
0

我在全球安装电子时遇到了同样的问题。这就是我所做的

rm -rf ~/.electron/
rm -rf ~/.atom/
npm cache clear
npm install

在此之后我再次运行命令..

npm install electron -g

如果这不起作用,您可以使用预构建的版本

npm install electron-prebuilt

这是我使用的资源..

于 2019-10-21T17:44:11.373 回答
0

这是错误是因为您主机上的 glibc 版本对于电子的某些依赖项来说太旧了。看起来你正在使用 Windows。我在使用 Debian Wheezy 时遇到了这个问题我发现的唯一解决方案是通过这个 hack 安装更新版本的 glibc:

如何在 Debian 上将 glibc 从版本 2.13 升级到 2.15?

你需要对 windows 做类似的事情。

于 2015-12-01T01:45:45.603 回答