npm run dev启动项目,electron提示throw new Error('Electron failed to install correctly, please delete node_modules/electron and try installing again')
npm run dev 项目,提示
throw new Error('Electron failed to install correctly, please delete node_modules/electron and try installing again')
根据提示删除electron包,重新安装一次,还是提示错误
单独安装electron
npm install electron -g
C:\Users\pxm\AppData\Roaming\npm\electron -> C:\Users\pxm\AppData\Roaming\npm\node_modules\electron\cli.js > core-js@3.6. postinstall C:\Users\pxm\AppData\Roaming\npm\node_modules\electron\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}" Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library! The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -) > electron@8.0. postinstall C:\Users\pxm\AppData\Roaming\npm\node_modules\electron
> node install.js (node:) UnhandledPromiseRejectionWarning: HTTPError: Response code (Not Found) for http://npm.taobao.org/mirrors/electron/v8.0.3/electron-v8.0.3-win32-x64.zip
at EventEmitter.<anonymous> (C:\Users\pxm\AppData\Roaming\npm\node_modules\electron\node_modules\got\source\as-stream.js::)
at EventEmitter.emit (events.js::)
at module.exports (C:\Users\pxm\AppData\Roaming\npm\node_modules\electron\node_modules\got\source\get-response.js::)
at ClientRequest.handleResponse (C:\Users\pxm\AppData\Roaming\npm\node_modules\electron\node_modules\got\source\request-as-event-emitter.js::)
at Object.onceWrapper (events.js::)
at ClientRequest.emit (events.js::)
at ClientRequest.origin.emit (C:\Users\pxm\AppData\Roaming\npm\node_modules\electron\node_modules\@szmarczak\http-timer\source\index.js::)
at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js::)
at HTTPParser.parserOnHeadersComplete (_http_common.js::)
at Socket.socketOnData (_http_client.js::)
(node:) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
+ electron@8.0.
added packages from contributors in .606s

提示 http://npm.taobao.org/mirrors/electron/v8.0.3/electron-v8.0.3-win32-x64.zip 无法访问
项目用到的electron 版本v7.1.14,试了 https://npm.taobao.org/mirrors/electron/v7.1.14/electron-v7.1.14-win32-x64.zip 也不行
去淘宝electron镜像,找到window 64位的electron,对应的地址是https://cdn.npm.taobao.org/dist/electron/7.1.14/electron-v7.1.14-win32-x64.zip

所以原因是地址问题,导致上面的错误
官方也给出原因:淘宝镜像的问题

同时官方给出的解决方法
例如,使用中国镜像: ELECTRON_MIRROR="https://cdn.npm.taobao.org/dist/electron/"
设置electron 镜像源地址:
npm config set electron_mirror https://cdn.npm.taobao.org/dist/electron/
参考:
Electron 8.0.2 Install Failed Because Of Wrong Download URL Path #22480
npm run dev启动项目,electron提示throw new Error('Electron failed to install correctly, please delete node_modules/electron and try installing again')的更多相关文章
- Electron桌面项目-解决throw new Error('Electron failed to install correctly, please delete node_modules..
前言 Electron 是一个用 HTML,CSS 和 JavaScript 来构建跨平台桌面应用程序的一个开源库.由GitHub开发的. 其原理是 Electron 通过将 Chromium 和 N ...
- npm run dev 启动项目报错我的解决办法
我的报错截屏 解决方案 1. config文件中 index 文件中的 host 值如果是数字串就将其改为 localhost 2. 再次尝试 如果有遇到其他问题阔以将 node-mo ...
- npm run dev启动项目报错 Cannot find module 'webpack-cli/bin/config-yargs'
一般是webpack的版本和webpackserver的版本不兼容导致的错误. 解决方法是先卸载这两个版本,再安装指定的版本. 卸载: 再安装指定或者最新版本的webpack和webpack-dev- ...
- vue中npm run dev运行项目不能自动打开浏览器! 以及 webstorm跑vue项目jshint一直提示错误问题的解决方法!
vue中npm run dev运行项目不能自动打开浏览器!以及 webstorm跑vue项目jshint一直提示错误问题的解决方法! 1.上个项目结束就很久没有使用vue了,最近打算用vue搭建自己的 ...
- vue中npm run dev运行项目自动打开浏览器
npm run dev运行项目自动打开浏览器设置自动打开浏览器 // 各种设备设置信息 host: 'localhost', //主机名 port: 8080, // 端口号(默认 ...
- Laravel5.5执行 npm run dev时报错,提示cross-env找不到(not found)的解决办法
Laravel 5.4 Mix & Laravel5.5执行 npm run dev时报错,提示cross-env找不到(not found)的解决办法 首先进入package.json文 ...
- VUE npm run dev 启动时,报了一大堆错误 Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 7.x
npm run dev 启动时,报了一大堆错误 Module build failed: Error: Missing binding E:\2017VocaSchool\vocationWeb\no ...
- 巨坑npm run dev 报错 终于找到正确答案 Error: EPERM: operation not permitted, open '/data/public/build/css/add.p
Windows10环境 npm run dev 报错 终于找到正确答案 Error: EPERM: operation not permitted, open '/data/public/build ...
- vue-cli webpack项目npm run dev启动过程
前言 通过vue init webpack和npm install命令初始化项目后,执行npm run dev就打开了网站http://localhost:8080.初学者不知道index.html. ...
随机推荐
- vue 路由钩子。
一.全局钩子 你可以使用 router.beforeEach 注册一个全局的 before 钩子: const router = new VueRouter({ ... }) router.befor ...
- 聊聊Grpc使用中的坑以及怎么填
总所周知,随着云技术的发展,和业务的复杂度的上升,越来越多的系统开始拆分成独立的子模块微服务.模块之间免不了相互通信.但是随着业务量的增多,传输量也随之增大,偶发性timeout,无响应, 传输量过大 ...
- meta标签设置不缓存
平常调试的时候总是因为缓存问题有些浪费时间,加上这几行代码就ok了 <meta http-equiv="Cache-Control" content="no-cac ...
- vue中mixins的使用方法和注意点(详2)(异步请求的情况)
当混合里面包含异步请求函数,而我们又需要在组件中使用异步请求函数的返回值时,我们会取不到此返回值,如下: mixin中 组件中 控制台 解决方案:不要返回结果而是直接返回异步函数 mixin中 组件中 ...
- mybatis 分页失败 始终pageSize = 2147483647
是在使用分页查询时 this.jobReadMapper.beginPager(pageParam);XXXXXXXXXXXXXXXXXXXXXXXXthis.xxxReadMapper.queryB ...
- RenderBox使用说明书&原理浅析
本文基于1.12.13+hotfix.8版本源码分析. 0.目录 一.RenderBox的用法 1.RenderBox的使用基本流程 2.RenderObjectWidget 3.非容器控件的hitT ...
- 两圆相交求面积 hdu5120
转载 两圆相交分如下集中情况:相离.相切.相交.包含. 设两圆圆心分别是O1和O2,半径分别是r1和r2,设d为两圆心距离.又因为两圆有大有小,我们设较小的圆是O1. 相离相切的面积为零,代码如下: ...
- ZOJ2532判断边是否是割集中的边
Internship Time Limit: 5 Seconds Memory Limit: 32768 KB CIA headquarter collects data from acro ...
- Pyqt5_QPushButton
QPushButton 状态 isDown() 提示按钮是否已按下 isChecked() 提示按钮是否已经标记 isEnable() 提示按钮是否可以被用户点击 isCheckAble() 提示按钮 ...
- 【学习】Python os模块常用方法 记录
记录一些工作中常用到的用法 os.walk() 模块os中的walk()函数可以遍历文件夹下所有的文件. os.walk(top, topdown=Ture, onerror=None, follow ...