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. 大技霸教你远程执行Linux脚本和命令

    如果现在需要在 Linux 服务器上执行一系列命令(比如搭建 LNMP 环境)我应该会第一时间想到想办法写个 Shell 脚本,然后扔上去执行以下看看结果. 然而一贯懒惰的我并不想这么去执行 Shel ...

  2. centos6 升级gcc 无法识别的命令行选项“-std=gnu++1y”的解决办法

    npm install 提示: 1.下载源文件,并安装: wget http://people.centos.org/tru/devtools-2/devtools-2.repo mv devtool ...

  3. 浅谈JQuery

    一.什么是JQuery? JQuery是第三方开发的执行DOM操作的极简化的函数库. 执行DOM操作:JQuery还是在执行DOM操作 1.学习JQuery还是在学习DOM 2.五件事:增删改查 事件 ...

  4. servlet--http接口简单的创建及调用

    很久没有用servlet的交互技术,生疏的遭不住.现在简单的说说servlet中http接口的创建及调用,便于大家理解,使用. 先说说服务端,就是提供服务方的代码: pom.xml <depen ...

  5. 201771010128王玉兰《面向对象程序设计(Java)》第十周学习总结

    第一部分:理论知识部分总结: (1) 定义简单泛型类: A:泛型:也称参数化类型(parameterizedtype),就是在定义类.接口和方法时,通过类型参数指 示将要处理的对象类型. B:泛型程序 ...

  6. Hyperledger Fabric——balance transfer(三)创建和加入Channel

    详细解析blance transfer示例的创建通道(Channel)和加入节点到通道的过程. 创建Channel 1.首先看app.js的路由函数 var createChannel = requi ...

  7. 手机短号(hdu2081)

    这里字符串的输入用gets_s()函数. #include<stdio.h> using namespace std; int main() { int N; scanf_s(" ...

  8. 《Head First 设计模式》:策略模式

    正文 一.定义 策略模式定义了算法族,分别封装起来,让它们之间可以相互替换,此模式让算法的变化独立于使用算法的客户. 要点: 策略模式把系统中会变化的部分抽出来封装. 二.实现步骤 1.创建策略接口 ...

  9. (板子) 最小生成树 买礼物 luogu P1194

    luogu题目传送门! 懒得找最小生成树模板了,就把这题当板子吧. 最小生成树,就是指对于一张图,我们将图转换成一棵树,连通的,同时让所有的边尽可能的小(废话). 最小生成树一般都采用Kruskal算 ...

  10. [Objective-C] 007_Foundation框架之NSString与NSMutableString

    在Cocoa Foundation中的NSString和NSMutableString类,为我们提供了Unicode字符串的支持,NSString和NSMutableString类最大的区别是:NSS ...