无法在Windows上安装contextify

时间:2015-08-28 23:05:16

标签: node.js windows

以下是我尝试安装contextify时返回的内容:

npm install contextify
npm WARN install Couldn't install optional dependency: Unsupported
npm WARN install Couldn't install optional dependency: Unsupported

> contextify@0.1.14 install F:\_vms\HomesteadCode\_live\misc\web-react\node_modules\contextify
> node-gyp rebuild


F:\_vms\HomesteadCode\_live\misc\web-react\node_modules\contextify>if not defined npm_config_node_gyp (node "C:\Program Files (x86)\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node  rebuild )
gyp: F:\Program Files (x86)\nodejs\common.gypi not found (cwd: F:\_vms\HomesteadCode\_live\misc\web-react\node_modules\contextify) while reading includes of binding.gyp while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:357:16)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "node" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd F:\_vms\HomesteadCode\_live\misc\web-react\node_modules\contextify
gyp ERR! node -v v0.12.7
gyp ERR! node-gyp -v v2.0.2
gyp ERR! not ok
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "contextify"
npm ERR! node v0.12.7
npm ERR! npm  v3.3.1
npm ERR! code ELIFECYCLE

npm ERR! contextify@0.1.14 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the contextify@0.1.14 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the contextify package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls contextify
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     F:\_vms\HomesteadCode\_live\misc\web-react\npm-debug.log

更新 安装好了......也许很难。

  • 已安装的Visual Studio 2013(已删除2015)
  • 确保我有最新的nodejs
  • 清理环境路径。 (结帐Rapidee
  • 添加系统变量:(我的:set VCTargetsPath=C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120
  • 从我的全局node_modules(对我F:\Program Files\nodejs\node_modules\npm\node_modules)我克隆了repo git clone git@github.com:brianmcd/contextify.git。 CD进入rm -rf .git
  • 我必须接下来npm i nan
  • node-gyp rebuild

安装后没有任何投诉!!!!

我希望有人提出比这更好的解决方案!!!

2 个答案:

答案 0 :(得分:0)

请看这个链接:

  

common.gypi not found error in node.js

     

这些天似乎是一个常见的问题。

     

您可以查看https://github.com/TooTallNate/node-gyp/issues/313和   https://github.com/TooTallNate/node-gyp/issues/376看看是否有任何   这些解决方案可以解决您的问题。

     

特别是,您可以:

     
      
  1. 删除旧目录〜/ .node_gyp并运行npm install

  2.   
  3. 将旧版本(例如:〜/ .node-gyp / 0.10.11 /)复制到合规路径。

  4.   
  5. 将最新版本复制到合规路径。

  6.   
  7. 在这个帖子中编钟以获得帮助。

  8.   

PS:

当我尝试在Windows上安装时,出现了完全不同的错误:

d:\temp>npm install -g contextify
> contextify@0.1.14 install C:\Users\paulsm\AppData\Roaming\npm\node_module\contextify
> node-gyp rebuild

C:\Users\paulsm\AppData\Roaming\npm\node_modules\contextify>node "D:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at failNoPython (D:\Program Files\nodejs\node_module\npm\node_modules\node-gyp\lib\configure.js:103:14)
<= NOTE: This is *not* your problem

当我在Linux机器上运行sudo npm install -g contextify时......“一切正常”。

再次 - 请查看上面的链接,看看它们是否有帮助。

答案 1 :(得分:0)

这是Windows上的python问题(https://github.com/nodejs/node-gyp/issues/629

你可能做的不多。您可以尝试一些解决方法,他们在评论中建议,但我不知道它会对您有多大帮助。