我想nodejs从很长一段时间安装.我尝试通过谷歌搜索,但严重的是我没有任何有效的解决方案.
我的第一个问题是
其次根据谷歌的建议我尝试下面的事情
https://github.com/TooTallNate/node-gyp了删除错误,但仍然无法正常工作.我有以下版本
当我运行时npm-install,错误显示如下
MSBUILD : error MSB3428: Could not load the Visual C++ component
"VCBuild.exe".To fix this, 1) install the .NET Framework 2.0 SDK, 2)
install Microsoft Visual Studio 2005 or 3) add the location of the
component to the system path if it is installed elsewhere.
Run Code Online (Sandbox Code Playgroud)
我package.json的如下:
{
"name": "TRest",
"version": …Run Code Online (Sandbox Code Playgroud) 运行npm install需要node-gyp重建的时,会抛出以下构建错误:
MSB8020:找不到v120(Platform Toolset ='v120')的构建工具.要使用v120构建工具进行构建,请安装v120构建工具.或者,您可以通过选择"项目"菜单或右键单击解决方案,然后选择"重新定位解决方案"来升级到当前的Visual Studio工具.
我们在项目中运行"npm install"时遇到问题.无法找到某个文件:
fatal error C1083: Cannot open include file: 'windows.h'
Run Code Online (Sandbox Code Playgroud)
它似乎来自node-gyp模块:
c:\ Program Files \nodejs \node_modules \npm \node_modules \node-gyp\src\win_delay_lo ad_hook.c(13):
致命错误C1083:无法打开包含文件:'windows.h':没有文件或目录[D:\ngs-frontend-next \node_modules\browser-sync \node_module s\socket.io \node_modules\engine.io \node_modules\ws \node_modules\bufferutil\buil \\ binding.sln]
这个节点gyp似乎是我们痛苦的永无止境的源头.起初它抱怨它需要python,所以我们安装了它.然后它抱怨它需要VCBuild,我们安装(使用.NET 2.0 SDK),现在我们有这个错误.这几乎就像错误变得越来越模糊,感觉就像我们走错了道路一样.
奇怪的是,我们团队中的其他人在运行npm-install时没有任何问题.
完整错误如下所示:
c:\ Program Files \nodejs \node_modules \npm \node_modules \node-gyp\src\win_delay_lo ad_hook.c(13):
致命错误C1083:无法打开包含文件:'windows.h':没有文件或目录[D:\ngs-frontend-next \node_modules\browser-sync \node_module s\socket.io \node_modules\engine.io \node_modules\ws \node_modules\bufferutil\buil \\ binding.sln]
gyp ERR!构建错误gyp ERR!堆栈错误:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe退出代码失败:ChildProcess.onExit上的1个堆栈(C:\ Program Files \nodejs \node_modules \npm \node _modules \node-gyp\lib\build.js:270:23)gyp ERR!堆栈在emitTwo(events.js:87:13)gyp ERR!堆栈在ChildProcess.emit(events.js:172:7)gyp ERR!Process.ChildProcess._handle.onexit(internal/child_proces s.js:200:12)gyp ERR!系统Windows_NT 6.1.7601 gyp ERR!命令"C:\ Program Files \nodejs …
在尝试编译标准的"Hello World"示例[2]时,我尝试在Windows 7 + Node.js平台上使用node-gyp失败[3].注意:当尝试npm install contextifyw或没有"-g"时,node-gyp以类似的方式失败[3] ,因此这些可能是相关的问题.
组态:
参考文献:
[1] https://github.com/TooTallNate/node-gyp/wiki/Visual-Studio-2010-Setup
[2] https://github.com/joyent/node/tree/master/test/addons/hello-world
[3]"hello world"[2]项目中的"node-gyp rebuild"产生以下2个错误:
.... node-gyp\0.10.24\deps\uv\include\win.h(8738):错误C2371:'SYSTEM_POWER_STATUS':重新定义; 不同的基本类型[...\build\test.vcxproj]
.... node-gyp\0.10.24\deps\uv\include\mswsock.h(27):致命错误C 1083:无法打开包含文件:'_mingw.h':没有这样的文件或目录[... \编译\ test.vcxproj]
以及2个警告:
.... node-gyp\0.10.24\deps\uv\include\win.h(13513):警告C4005:'UNALIGNED':宏重新定义[...\build\test.vcxproj]
.... node-gyp\0.10.24\deps\uv\include\mswsock.h(26):警告C4068:未知的编译指示[...\build\test.vcxproj]
完整的跟踪如下:
C:\sigma\node_modules\x>node-gyp rebuild
gyp info it worked if it ends with ok
gyp info using node-gyp@0.12.2
gyp info using node@0.10.24 | win32 | x64
gyp info spawn …Run Code Online (Sandbox Code Playgroud) Ubuntu 14.04
nodejs version is v4.1.1 installed with these commands:
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
sudo apt-get install -y nodejs
Run Code Online (Sandbox Code Playgroud)
mongodb installed via mongodb docs tutorial
Next I tried installing mongoose by doing
sudo npm install mongoose
Run Code Online (Sandbox Code Playgroud)
I received the following error:
> kerberos@0.0.14 install /root/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/node_modules/kerberos
> (node-gyp rebuild) || (exit 0)
gyp ERR! build error
gyp ERR! stack Error: not found: make
gyp ERR! stack at F (/usr/lib/node_modules/npm/node_modules/which/which.js:73:28)
gyp ERR! stack at E (/usr/lib/node_modules/npm/node_modules/which/which.js:76:29)
gyp ERR! …Run Code Online (Sandbox Code Playgroud) 我最近买了一台Mac,它使用Mac OSX El Capitan v10.11.4.使用自制软件安装节点,并使用节点v6.2.2和npm v3.9.5.我在使用bcrypt时遇到错误npm install,我认为这是由node-gyp rebuild错误引起的.我最近也下载了xcode-select(版本2343)和xcode(7.3.1)(按此顺序).
这是我运行后的完整错误输出npm install:
https://gist.github.com/varunjayaraman/5734af617d616437cd5b3456b20bc503
不确定出了什么问题.我来自linux的土地,并且确实对自己不从源代码安装保持警惕,所以也许这就是导致这些问题的原因?无论如何,任何建议都会受到超级赞赏.我也看到这个错误在其他人身上涌现,但他们的解决方案似乎都没有用(当我输入时xcode-select --print-path,我得到了/Applications/Xcode.app/Contents/Developer)
我正在尝试使用edge.js来执行一些.NET代码,以便在Electron应用程序的Windows上打印.我已经尝试了电子边缘,我也尝试按照Electron文档中的说明手动构建针对Electron的edge.js模块,但是当我尝试在打包的应用程序中使用edge时,我不断收到以下错误:
Error: The specified module could not be found.
\\?\C:\path\to\app\app-1.0.0\resources\app.asar.unpacked\node_modules\edge\lib\native\win32\x64\6.5.0\edge_nativeclr.node
at Error (native)
at process.module.(anonymous function) (ELECTRON_ASAR.js:178:20)
at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:178:20)
at Object.Module._extensions..node (module.js:583:18)
at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:192:18)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
at Module.require (module.js:483:17)
at require (internal/module.js:20:19)
Run Code Online (Sandbox Code Playgroud)
我已经检查了文件系统edge_nativeclr.node,事实上,模块确实存在.我的怀疑是我不知道是不是正确构建模块,它可能仍然针对节点的错误版本,因此电子无法导入模块.
我尝试了几种不同的方法,包括按照电子边缘的步骤手动更新build.bat并将--target=1.4.12 --dist-url=https://atom.io/download/atom-shell标志添加到node-gyp configure build.
我还在我的设置中设置了以下npm配置选项.npmrc:
target=1.4.12
arch=x64
target_arch=x64
disturl=https://atom.io/download/electron
runtime=electron
build_from_source=true
msvs_version=2015
Run Code Online (Sandbox Code Playgroud)
并运行 …
我正在为我的硬盘驱动器制定备份计划,我想知道是否需要备份隐藏文件夹"〜/ .npm"和"〜/ .node-gyp"?或者它们只是临时文件夹,其内容是自动构建的?
我在执行时遇到以下错误npm install:
$ npm install
npm ERR! code 127
npm ERR! path /home/jesusjimenez/projects/project/node_modules/fibers
npm ERR! command failed
npm ERR! command sh -c node build.js || nodejs build.js
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@3.8.0
npm ERR! gyp info using node@15.12.0 | linux | x64
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Command failed: /usr/bin/python3 -c import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! …Run Code Online (Sandbox Code Playgroud) node-gyp ×10
node.js ×8
npm ×5
javascript ×2
msbuild ×2
windows-10 ×2
backup ×1
contextify ×1
edgejs ×1
electron ×1
kerberos ×1
mongoose ×1
node-modules ×1
npm-install ×1
python ×1
ruby ×1
ubuntu ×1
windows ×1