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

Electron failed to install correctly, please delete node_modules/electron and try installing again #20994

Electron 文档-安装

淘宝electron镜像

npm run dev启动项目,electron提示throw new Error('Electron failed to install correctly, please delete node_modules/electron and try installing again')的更多相关文章

  1. Electron桌面项目-解决throw new Error('Electron failed to install correctly, please delete node_modules..

    前言 Electron 是一个用 HTML,CSS 和 JavaScript 来构建跨平台桌面应用程序的一个开源库.由GitHub开发的. 其原理是 Electron 通过将 Chromium 和 N ...

  2. npm run dev 启动项目报错我的解决办法

    我的报错截屏 解决方案   1.    config文件中 index 文件中的 host 值如果是数字串就将其改为 localhost 2.    再次尝试 如果有遇到其他问题阔以将 node-mo ...

  3. npm run dev启动项目报错 Cannot find module 'webpack-cli/bin/config-yargs'

    一般是webpack的版本和webpackserver的版本不兼容导致的错误. 解决方法是先卸载这两个版本,再安装指定的版本. 卸载: 再安装指定或者最新版本的webpack和webpack-dev- ...

  4. vue中npm run dev运行项目不能自动打开浏览器! 以及 webstorm跑vue项目jshint一直提示错误问题的解决方法!

    vue中npm run dev运行项目不能自动打开浏览器!以及 webstorm跑vue项目jshint一直提示错误问题的解决方法! 1.上个项目结束就很久没有使用vue了,最近打算用vue搭建自己的 ...

  5. vue中npm run dev运行项目自动打开浏览器

    npm run dev运行项目自动打开浏览器设置自动打开浏览器 // 各种设备设置信息      host: 'localhost', //主机名      port: 8080, // 端口号(默认 ...

  6. Laravel5.5执行 npm run dev时报错,提示cross-env找不到(not found)的解决办法

    Laravel 5.4 Mix & Laravel5.5执行 npm run dev时报错,提示cross-env找不到(not found)的解决办法   首先进入package.json文 ...

  7. 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 ...

  8. 巨坑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 ...

  9. vue-cli webpack项目npm run dev启动过程

    前言 通过vue init webpack和npm install命令初始化项目后,执行npm run dev就打开了网站http://localhost:8080.初学者不知道index.html. ...

随机推荐

  1. .Net(c#)使用 Kafka 小结

    .Net(c#)使用 Kafka 小结 1.开篇 由于项目中必须使用 kafka 来作为消息组件,所以使用 kafka 有一段时间了.不得不感叹 kafka 是一个相当优秀的消息系统.下面直接对使用过 ...

  2. js 实时获取屏幕高度并赋值

    var that = this; var h = 1344,w=750; var orderHight1 = document.body.clientHeight; var orderWidth1 = ...

  3. 线上Kafka突发rebalance异常,如何快速解决?

    文章首发于[陈树义的博客],点击跳转到原文<线上Kafka突发rebalance异常,如何快速解决?> Kafka 是我们最常用的消息队列,它那几万.甚至几十万的处理速度让我们为之欣喜若狂 ...

  4. Spring AOP实现接口验签

    因项目需要与外部对接,为保证接口的安全性需要使用aop进行方法的验签; 在调用方法的时候,校验外部传入的参数进行验证, 验证通过就执行被调用的方法,验证失败返回错误信息: 不是所有的方法都需要进行验签 ...

  5. IIS 报 :HTTP Error 503. The service is unavailable.

    打开IIS 找到你对应的网站名称然后你会发现应用池停止了 点击你对应的网站右键点击启动既可

  6. linux连个文件都删除不了,什么鬼!

    前言 最近不是redis 6.0 出了吗,官网介绍最新稳定版本是 6.0.3 .于是,我就准备在自己的破小服务器上安装一下.于是,出现了后续的糟心事 (linux 下的文件正常删除不了). 下载了最新 ...

  7. NOIP 2017 P3959 宝藏 (状态压缩DP板子)

    洛谷题目传送门!! 题目的N这么小,当然是选择用状压DP啦!  等等,我好像不会状缩.... 首先,我们当然是要写状态转移方程了!! 那么,如果我们设  f[s]  状态s下,所要的最小花费,那么很显 ...

  8. This的关键字的使用

    this: 1.可以用来修饰属性  方法 构造器 2.this理解为当前对象或当前正在创建的对象. 3.可以在构造器中通过this()形参的方式显示的调用本类中其他重载的指定的构造器 要求: 在构造器 ...

  9. ATT&CK如何落地到安全产品

    科普:ATT&CK是什么 ATT&CK的提出是为了解决业界对黑客行为.事件的描述不一致.不直观的问题,换句话说它解决了描述黑客行为 (TTP) 的语言和词库,将描述黑客攻击的语言统一化 ...

  10. 树莓派4B获取IP地址的几种简易方法

    首先声明一下,使用的是Paspbian系统,其实其他系统和本文说的获取IP地址关系也不大. 1.当你有路由器,有PC客户端的情况,你把你的树莓派用网线将其连接起来.你可以借助这个软件,advanced ...