试着安装卡玛
npm install -g karma发出警告
npm WARN optional dep failed, continuing fsevents@0.3.5最后似乎没有安装Karma。
karma init karma.config.js
'karma' is not recognized as an internal or external command (so a windows installation).然而,似乎有一个业力
C:\Users\Me\AppData\Roaming\npm\node_modules\karma和一个builerror.log文件
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 (c:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:103:14)
gyp ERR! stack at c:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:64:11
gyp ERR! stack at Object.oncomplete (evalmachine.<anonymous>:108:15)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "c:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Me\AppData\Roaming\npm\node_modules\karma\node_modules\socket.io\node_modules\socket.io-client\node_modules\ws
gyp ERR! node -v v0.10.36
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok 我是否需要安装python来处理业力,还是有其他问题?提前感谢您的帮助!
发布于 2015-02-11 10:09:15
您需要安装命令行接口,以便识别karma:
npm install -g karma-clinode-gyp错误是因为没有安装python。要避免该错误,请执行以下步骤:
Windows /Vista/7:- Microsoft C++ 2013 (快速版本运行良好)-如果安装失败,请尝试卸载任何C++ 2010 x64和x86
Redistributable that you have installed first - If you get errors that the 64-bit compilers are not installed you may also need the compiler update for the Windows SDK 7.1Windows 7/8: - Microsoft C++ 2013 for Windows (快速版本运行良好)
Windows 10: -安装VisualStudioCommunity2015版。(自定义安装,在安装过程中选择VisualC++)-设置环境变量GYP_MSVS_VERSION=2015 -以管理员身份运行命令提示符
如果以上步骤未起作用或您不确定,请访问http://www.serverpals.com/blog/building-using-node-gyp-with-visual-studio-express-2015-on-windows-10-pro-x64以获得完整的演练
所有Windows版本的-对于节点和本机模块的64位构建,您还需要Windows764位SDK。
如果您的构建抱怨没有设置WindowsSDKDir,并且您确信已经安装了SDK,您可能需要运行以下命令之一:
call "C:\Program Files\Microsoft SDKs\Windows\v7.1\bin\Setenv.cmd" /Release /x86
call "C:\Program Files\Microsoft SDKs\Windows\v7.1\bin\Setenv.cmd" /Release /x64来源:节点- Github
发布于 2015-10-09 07:30:44
来自https://stackoverflow.com/a/21366601/368997的参考。
Karma请求节点-gyp,而node-gyp有它自己的依赖(来自github)。特别是,您需要使用并确保您有一个PYTHON环境变量。
https://stackoverflow.com/questions/28451504
复制相似问题