在 Windows 上 npm 安装 jsdom 错误? [英] npm install jsdom error on windows?

查看:119
本文介绍了在 Windows 上 npm 安装 jsdom 错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在我的 Windows 电脑上安装了 nodejs.它工作正常.但是当我尝试安装 jsdom 时npm install jsdom"这个错误提示我.

I have installed nodejs on my windows pc. And it was working fine. But when I tried to install jsdom using "npm install jsdom" I was prompoted by this error.

节点C:\ProgramFiles\nodejs\node_modules\npm\bin\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js"重建信息吧如果以 ok 结尾,则工作
呃!错误:Python 似乎没有安装
在 failNoPython (C:\ProgramFiles\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:78:14)在 Object.oncomplete (C:\Program文件\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:66:11)呃!不行
npm WARN 可选依赖项失败,继续 contextify@0.1.2
jsdom@0.2.13 ./node_modules/jsdom
+-- cssom@0.2.3 +-- htmlparser@1.7.5

node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild info it worked if it ends with ok
ERR! Error: Python does not seem to be installed
at failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:78:14) at Object.oncomplete (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:66:11) ERR! not ok
npm WARN optional dependency failed, continuing contextify@0.1.2
jsdom@0.2.13 ./node_modules/jsdom
+-- cssom@0.2.3 +-- htmlparser@1.7.5

有人能帮我解决这个问题吗?

Can anyone help me regarding this problem?

推荐答案

我在 Windows 7 (x64 Ultimate) 上遇到了同样的问题,经过数小时的搜索和试用,以下是我解决它的方法.请按照完全相同的顺序执行以下步骤:

I had the same issue on Windows 7 (x64 Ultimate), after hours of search and trials, here is how I resolved it. Please follow the steps in the same exact order:

  1. 安装 Visual Studio 2010/2012 C++(Express 或更高版本)
  2. 安装 Windows SDK 7.1
  3. 安装适用于 Windows SDK 7.1 的 Microsoft Visual C++ 2010 Service Pack 1 编译器更新"
  4. 安装 GTK (C:\GTK)
  5. 安装 Python (C:\Python27)
  6. 安装 node.js (x86)
  7. 将 [node.js] 添加到路径 (C:\Program Files (x86)\nodejs\;)
  8. 将 [python] 添加到路径 (C:\Python27\;)
  9. 将 [GTK] 添加到路径 (C:\GTK\bin;)
  10. 添加 [WindowsSDKDir] 系统变量指向C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin"
  11. 以管理员身份运行Windows SDK 7.1 命令提示符"
  12. 使用setenv/x86"将环境设置为 x86
  13. 将目录更改为C:\Program Files (x86)\nodejs\"
  14. 运行npm install -g npm"
  15. 运行npm update -g npm"
  16. 运行npm install -g node-gyp"
  17. 运行node-gyp configure build"
  18. 运行npm install jsdom"
  19. 运行npm install ajax"
  20. 运行npm install http-server"
  21. 运行npm install jquery"
  22. 运行npm install xmlhttprequest"
  23. 运行npm update"

我希望这会有所帮助.

这篇关于在 Windows 上 npm 安装 jsdom 错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆