Electron npm install 常见错误(Windows)
问题一:node_gyp使用版本不对
if not defined npm_config_node_gyp (node "C:\Users\Administrator\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Users\Administrator\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
问题:明明装的是5.0.2版本,使用的却是3.9.2版本。
原因:命令上已经写明,在npm_config_node_gyp未配置情况,node_gyp使用的版本。
解决:删掉前者路径的node-gyp。
问题二:无法找到 v140 的生成工具
C:\Program Files (x86)\Microsoft Visual Studio\\BuildTools\Common7\IDE\VC\VCTargets\Microsoft.Cpp.Platform.targets(
,): error MSB8020: 无法找到 v140 的生成工具(平台工具集 =“v140”)。若要使用 v140 生成工具进行生成,请安装 v140 生成工具。或者,可以升级到当前 Visual Studio 工具,方式是通过选择
“项目”菜单或右键单击该解决方案,然后选择“重定解决方案目标”。 [F:\project\electron-source\node_modules\better-sqlite3\build\deps\locate_sqlite3.vcxpr
oj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code:
gyp ERR! stack at ChildProcess.onExit (C:\Users\Administrator\AppData\Roaming\npm\node_modules\node-gyp\lib\build.js::)
gyp ERR! stack at ChildProcess.emit (events.js::)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js::)
gyp ERR! System Windows_NT 10.0.
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Administrator\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd F:\project\electron-source\node_modules\better-sqlite3
gyp ERR! node -v v10.3.0
gyp ERR! node-gyp -v v5.0.2
gyp ERR! not ok
问题:依赖的c++插件库,总是编译出错,报没有v140工具。
原因:缺少 Visual Studio v140工具。
解决:
1、去到 C:\Program Files (x86)\Microsoft Visual Studio\Installer 目录。
2、打开 Visual Studio Installer 工具。
3、安装 MSVC v140 - VS 2015 C++ 生成工具(v14.00) 工具。
问题三:This is a bug in `node-pre-gyp`
node-pre-gyp ERR! Completion callback never invoked!
node-pre-gyp ERR! System Windows_NT 10.0.
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "F:\\project\\electron-source\\node_modules\\@journeyapps\\sqlcipher\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd F:\project\electron-source\node_modules\@journeyapps\sqlcipher
node-pre-gyp ERR! node -v v10.3.0
node-pre-gyp ERR! node-pre-gyp -v v0.10.0
node-pre-gyp ERR! This is a bug in `node-pre-gyp`.
node-pre-gyp ERR! Try to update node-pre-gyp and file an issue if it does not help:
node-pre-gyp ERR! <https://github.com/mapbox/node-pre-gyp/issues>
问题:执行到node-pre-gyp总是报错。
原因:未知。
解决:重启下电脑,就可以了……
Electron npm install 常见错误(Windows)的更多相关文章
- Electron npm install 常见错误(Linux)
Linux版本 Ubuntu 12.04 (32bit) 安装Git sudo apt-get install git 生成ssh key #查看有没有sshkey cd ~/.ssh #生成 ssh ...
- Windows环境下npm install常见错误
Windows环境下npm install安装包依赖时,常出现一些错误,下面为个人解决办法: 错误一 缺少python环境: G:\nodejs\moviesite\node_modules\bcry ...
- node.js的npm命令常见错误及解决方案
使用npm命令进行模块安装的时候场出现各种错误,本文总结我所遇到的各种错误,并提供解决方案.(大部分内容为网上收集) 首先使用淘宝 NPM 镜像 大家都知道国内直接使用 npm 的官方镜像是非常慢的, ...
- npm install mongoose错误解决
今天安装mongoose一直报错,上图 具体的错误记录: info it worked if it ends with ok verbose cli [ 'C:\\Program Files\\nod ...
- Python学习笔记: pip install 常见错误汇总
本机环境RHEL8, Python3.9 pip install: 无法安装最新版本的包 在pypi上查看pkg的页面,因为有些pip包的版本对特定的python版本有要求 pip install e ...
- npm install依赖时,常见错误
1.npm install依赖时,报错:npm ERR! Unexpected end of JSON input while parsing near '...gin":"^1. ...
- 笔记:npm常见错误
常见错误 破坏的npm安装 随机错误 找不到兼容版本 权限错误 Error: ENOENT, stat 'C:\Users\<user>\AppData\Roaming\npm' 在Win ...
- NPM 常见错误
找不到兼容版本 你有一个过时的npm.请更新到最新稳定的npm. 权限错误 npm ERR! code EPERM npm ERR! code EACCES 修复缓存的权限sudo chown -R ...
- npm 安装 electron 出现的奇葩错误
起因 使用yarn安装electron有时稳定,在搭配别的框架时有时又出现无解的错误了,于是打开electron官网,发现: emm,似乎官方对npm情有独钟.于是我遵从官方旨意使用npm安装elec ...
随机推荐
- activate-power-mode,让你在Python编码中,感受炫酷的书写特效!
Atom Atom 是github专门为程序员推出的一个跨平台文本编辑器,具有简洁和直观的图形用户界面,并有很多有趣的特点:支持CSS,HTML,JavaScript等网页编程语言.说到这里大家以为我 ...
- uglify-js 和uglify-es
uglify-js 它不支持压缩 es6,参考github的issue It seems like uglify-js does not support es6? uglify-js在压缩代码时,遇到 ...
- js练习- 给你一个对象,求有几层
// 比如这个a中,就有四层.如何算出这四层 const a = { b: 1, c() {}, d: { e: 2, f: { g: 3, h: { i: 4, }, }, j: { k: 5, } ...
- axios报错: Cannot read property 'protocol' of undefined ....
错误: Uncaught (in promise) TypeError: **Cannot read property 'protocol' of undefined ... 源码: 完整错误: im ...
- nitacm20317 来自张司机的挑战书
题目:让你求从x到y中(1<=x<=y<=10^18),二进制一的个数最多的数是哪个,如果有多个相同的答案,输出最小的. 题目链接:https://www.nitacm.com/pr ...
- AtCoder-3867
Find the maximum possible sum of the digits (in base 10) of a positive integer not greater than N. C ...
- NET视频教程分享
地址:链接:https://pan.baidu.com/s/1q47WN1XFw19vLZ8XZqnB_g 提取码:8ut2 这是我收集的一套.NET学习视频教程(某智24期视频),分享出来, ...
- Ceph 架构以及原理分析
一.架构 Ceph在一个统一的系统中独特地提供对象,块和文件存储. Ceph高度可靠,易于管理且免费. Ceph的强大功能可以改变您公司的IT基础架构以及管理大量数据的能力. Ceph提供了非凡的可扩 ...
- 大数据学习笔记——Hadoop编程实战之HDFS
HDFS基本API的应用(包含IDEA的基本设置) 在上一篇博客中,本人详细地整理了如何从0搭建一个HA模式下的分布式Hadoop平台,那么,在上一篇的基础上,我们终于可以进行编程实操了,同样,在编程 ...
- 【ZooKeeper系列】2.用Java实现ZooKeeper API的调用
温馨提示:在这里我再次提个小要求,希望大家能习惯看官方文档,文档虽然是英文但用词都比较简单,基本都能看懂文档表达的意思.授之以鱼不如授之以渔的道理相信大家都明白,也希望通过猿人谷的这个ZooKeepe ...