热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

ElectronJs:无法安装“install.js:22throwerr”-ElectronJs:Notabletoinstall“install.js:22throwerr”

IamstartingwithElectronjsandIhavestumbledontheveryfirststepwhichisinstalledElectro

I am starting with Electron js and I have stumbled on the very first step which is installed Electron.

我开始使用Electron js,我偶然发现安装了Electron的第一步。

I am running the following command to install electron provided at source

我正在运行以下命令来安装源代码提供的电子

npm install electron-prebuilt --save-dev

Following is the result of the command

以下是该命令的结果

C:\Users\vikas\Desktop\electron apps\example>npm install electron-prebuilt --sa
ve-dev

electron-prebuilt@0.37.8 postinstall C:\Users\vikas\Desktop\electron apps\exa
mple\node_modules\electron-prebuilt
node install.js
C:\Users\vikas\Desktop\electron apps\example\node_modules\electron-prebuilt\ins
tall.js:22
throw err
^

Error: end of central directory record signature not found
at C:\Users\vikas\Desktop\electron apps\example\node_modules\yauzl\index.js
:167:14
at C:\Users\vikas\Desktop\electron apps\example\node_modules\yauzl\index.js
:473:5
at C:\Users\vikas\Desktop\electron apps\example\node_modules\fd-slicer\inde
x.js:32:7
at FSReqWrap.wrapper as oncomplete
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\vikas\Desktop
\electron apps\example\package.json'
npm WARN example No description
npm WARN example No repository field.
npm WARN example No README data
npm WARN example No license field.
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\vikas\AppData\
\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install" "electron-prebuilt"
"--save-dev"
npm ERR! node v4.4.3
npm ERR! npm v3.8.9
npm ERR! code ELIFECYCLE

npm ERR! electron-prebuilt@0.37.8 postinstall: node install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the electron-prebuilt@0.37.8 postinstall script 'node install
.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the electron-prebuilt pac
kage,
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 information on how to open an issue for this project with:
npm ERR! npm bugs electron-prebuilt
npm ERR! Or if that isn't available, 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\vikas\Desktop\electron apps\example\npm-debug.log

Windows 8.1

Windows 8.1

NPM Version 3.8.9

NPM版本3.8.9

3 个解决方案

#1


0  

Does C:\Users\vikas\Desktop\electron apps\example\package.json exist? If not try running npm init to create it, and then run npm install electron-prebuilt --save-dev again.

C:\ Users \ vikas \ Desktop \ electron apps \ example \ package.json是否存在?如果没有尝试运行npm init来创建它,然后再次运行npm install electron -prebuilt --save-dev。

#2


0  

this is bug and a workaround is provided on github : Source

这是bug,并在github上提供了一个解决方法:Source

Here is the workaround:

这是解决方法:

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

#3


0  

I was facing a similar issue. But opening the command prompt as administrator (Windows) and reinstalling electron fixed the issue.

我面临着类似的问题。但是以管理员身份打开命令提示符(Windows)并重新安装电子修复了问题。


推荐阅读
author-avatar
你妈咪叫你吃饭呢
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有