在nodejs上安装jsdom, node-gyp错误:生成ENOENT。

时间:2022-04-26 15:27:31

After three days trying to install jsdom on Windows Server 2008 R2 x64 i finally decided to post here as all the solutions given in the other similar posts did not work for me.

在Windows Server 2008 R2 x64上尝试安装jsdom 3天之后,我终于决定在这里发布,因为其他类似帖子中给出的所有解决方案对我都不起作用。

Here's what I've done so far on my x64 OS:

这是我迄今为止在x64操作系统上所做的:

  • Installed Python (v2.7.8) and added it to the system path (C:\Python) and created a new variable PYTHON=C:\Python\python.exe which is definitely where the python executable is.
  • 安装了Python (v2.7.8)并将其添加到系统路径(C:\Python)并创建了一个新的变量Python =C:\Python\ Python。exe,这是python可执行文件的确切位置。
  • Installed MS VS C++ 2010 Express Version.
  • 安装MS VS c++ 2010 Express版本。
  • Installed Windows SDK 7.1.
  • 安装Windows SDK 7.1。

my software versions are:

我的软件版本:

  • node.js: v0.10.33
  • 节点。js:v0.10.33
  • npm: v1.4.28
  • npm:v1.4.28
  • node-gyp: v1.0.1
  • node-gyp:v1.0.1

When i try to install jsdom ("npm insall jsdom" on project folder) i get the following error:

当我尝试在项目文件夹中安装jsdom(“npm insall jsdom”)时,我得到以下错误:

在nodejs上安装jsdom, node-gyp错误:生成ENOENT。

I can read in every similar post that it is python environment variable issue but i already registered them:

我可以在每个类似的帖子中看到它是python环境变量问题,但我已经注册了:

在nodejs上安装jsdom, node-gyp错误:生成ENOENT。

I also tried installing node.js v0.8.25 with same result, so i went back to v0.10.33.

我还尝试了安装node。同样的结果,我回到了v0.10.33。

I also tried setting "npm config set python C:\Python\" before launching npm install.

在启动npm安装之前,我还尝试设置了“npm config set python C:\ python \”。

I don't know what else to try..

我不知道还能尝试什么。

1 个解决方案

#1


1  

follow my README file to install D3 (it depends on Jsdom). Cheers

按照我的README文件安装D3(它依赖于Jsdom)。干杯

INSTALLING D3 NPM PACKAGE IN NODEJS ON WINDOWS 7x64

D3 pkg cannot be installed properly on Windows OS without a right setup. D3 depends on JSDOM, which has a dependency on CONTEXTIFY (Python and C++).

如果没有正确的设置,D3 pkg不能正确安装在Windows操作系统上。D3依赖于JSDOM,它依赖于上下文(Python和c++)。

The following steps applied on Windows 7x64 Ultimate:

以下步骤应用于Windows 7x64 Ultimate:

INSTALL

SETUP (set environment variable windows)

  • Add a custom folder ..\%USERNAME% to PATH (ex. C:\Users\Max)
  • 添加自定义文件夹。\%用户名% to PATH (ex. c:users\ Max)
  • Add python folder to PATH (ex. C:\Python27)
  • 将python文件夹添加到PATH (ex. C:\Python27)
  • Add a new System Variable with name WindowsSDKDir and key the WinSDK bin folder (ex. C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin)
  • 添加一个新的系统变量名称WindowsSDKDir和关键WinSDK bin文件夹(例如C:\Program Files\Microsoft sdk \ Windows \ v7.1 \ bin)。

RUN

  • Run Windows SDK 7.1 Command Prompt as Administrator
  • 作为管理员运行Windows SDK 7.1命令提示符。
  • Set environment to x86 using [setenv /x86]
  • 使用[setenv /x86]将环境设置为x86
  • Change directory to the custom folder (ex. C:\Users\Max)
  • 将目录更改为自定义的文件夹(例如C:\Users\ Max)。

Finally, install d3 with [npm install d3].

最后,安装d3与[npm安装d3]。

#1


1  

follow my README file to install D3 (it depends on Jsdom). Cheers

按照我的README文件安装D3(它依赖于Jsdom)。干杯

INSTALLING D3 NPM PACKAGE IN NODEJS ON WINDOWS 7x64

D3 pkg cannot be installed properly on Windows OS without a right setup. D3 depends on JSDOM, which has a dependency on CONTEXTIFY (Python and C++).

如果没有正确的设置,D3 pkg不能正确安装在Windows操作系统上。D3依赖于JSDOM,它依赖于上下文(Python和c++)。

The following steps applied on Windows 7x64 Ultimate:

以下步骤应用于Windows 7x64 Ultimate:

INSTALL

SETUP (set environment variable windows)

  • Add a custom folder ..\%USERNAME% to PATH (ex. C:\Users\Max)
  • 添加自定义文件夹。\%用户名% to PATH (ex. c:users\ Max)
  • Add python folder to PATH (ex. C:\Python27)
  • 将python文件夹添加到PATH (ex. C:\Python27)
  • Add a new System Variable with name WindowsSDKDir and key the WinSDK bin folder (ex. C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin)
  • 添加一个新的系统变量名称WindowsSDKDir和关键WinSDK bin文件夹(例如C:\Program Files\Microsoft sdk \ Windows \ v7.1 \ bin)。

RUN

  • Run Windows SDK 7.1 Command Prompt as Administrator
  • 作为管理员运行Windows SDK 7.1命令提示符。
  • Set environment to x86 using [setenv /x86]
  • 使用[setenv /x86]将环境设置为x86
  • Change directory to the custom folder (ex. C:\Users\Max)
  • 将目录更改为自定义的文件夹(例如C:\Users\ Max)。

Finally, install d3 with [npm install d3].

最后,安装d3与[npm安装d3]。