2015-06-22 119 views
0

当我使用下面的命令:错误,当我尝试运行NPM安装-g量角器

npm install -g protractor 

失败,并给了我下面的错误

LINK : fatal error LNK1181: cannot open input file 'gdi32.lib' [C:\Users\Develo per\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver \node_modules\ws\node_modules\bufferutil\build\bufferutil.vcxproj] gyp ERR! build error 
    gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe` fail 
    ed with exit code: 1 
    gyp ERR! stack  at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\ 
    npm\node_modules\node-gyp\lib\build.js:269:23) 
    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\\nodejs\\node_modules\\npm\\node_modu 
    les\\node-gyp\\bin\\node-gyp.js" "rebuild" 
    gyp ERR! cwd C:\Users\Developer\AppData\Roaming\npm\node_modules\protractor\node 
    _modules\selenium-webdriver\node_modules\ws\node_modules\bufferutil 
    gyp ERR! node -v v0.12.4 
    gyp ERR! node-gyp -v v1.0.3 
    gyp ERR! not ok 

    > [email protected] install C:\Users\Developer\AppData\Roaming\npm\node_modul 
    es\protractor\node_modules\selenium-webdriver\node_modules\ws\node_modules\utf-8 
    -validate 
    > node-gyp rebuild 



C:\Users\Developer\AppData\Roaming\npm\node_modules\protractor\node_modules\sele 
nium-webdriver\node_modules\ws\node_modules\utf-8-validate>if not defined npm_co 
nfig_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\ 
..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild) else (rebuild) 
Building the projects in this solution one at a time. To enable parallel build, 
please add the "/m" switch. 
    validation.cc 
LINK : fatal error LNK1181: cannot open input file 'gdi32.lib' [C:\Users\Develo 
per\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver 
\node_modules\ws\node_modules\utf-8-validate\build\validation.vcxproj] 
gyp ERR! build error 
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe` fail 
ed with exit code: 1 
gyp ERR! stack  at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\ 
npm\node_modules\node-gyp\lib\build.js:269:23) 
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\\nodejs\\node_modules\\npm\\node_modu 
les\\node-gyp\\bin\\node-gyp.js" "rebuild" 
gyp ERR! cwd C:\Users\Developer\AppData\Roaming\npm\node_modules\protractor\node 
_modules\selenium-webdriver\node_modules\ws\node_modules\utf-8-validate 
gyp ERR! node -v v0.12.4 
gyp ERR! node-gyp -v v1.0.3 
gyp ERR! not ok 
npm WARN optional dep failed, continuing [email protected] 
npm WARN optional dep failed, continuing [email protected] 
C:\Users\Developer\AppData\Roaming\npm\protractor -> C:\Users\Developer\AppData\ 
Roaming\npm\node_modules\protractor\bin\protractor 
C:\Users\Developer\AppData\Roaming\npm\webdriver-manager -> C:\Users\Developer\A 
ppData\Roaming\npm\node_modules\protractor\bin\webdriver-manager 
[email protected] C:\Users\Developer\AppData\Roaming\npm\node_modules\protractor 
├── [email protected] 
├── [email protected] 
├── html-en[email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] ([email protected], [email protected]) 
├── [email protected] ([email protected], [email protected]) 
├── [email protected] ([email protected], [email protected]) 
├── [email protected] ([email protected]) 
├── [email protected] ([email protected], [email protected], [email protected], tunn 
[email protected], [email protected], [email protected], [email protected], [email protected] 
3, [email protected], [email protected], [email protected], [email protected]) 
└── [email protected] ([email protected], [email protected], [email protected], [email protected]) 

任何想法如何解决这个?

请给我支持。 happend给我

+0

嗨,老兄,你需要评论的问题,那是什么 –

+0

这是试图安装量角器时错误我angularjs project – ahmad

+0

这是令人讨厌的,我找不到任何资源如何解决这个问题,我编辑了我正在做的步骤。 – ahmad

回答

0

这个错误,当我卸载的Visual Studio 2013我在Windows 10

安装VS 2015年之后有什么帮助了我,是为了纠正节点GYP的依赖!

只要按照节点GYP在Windows的安装说明,然后一切都应该好起来工作:https://github.com/nodejs/node-gyp