安装量角器时出现错误 gyp



>当我尝试安装

npm i protractor

我有错误。我已安装2015 msvs_versionGYP_MSVS_VERSION=2015

C:Program Files (x86)MSBuildMicrosoft.Cppv4.0Platformsx64Microsoft.Cpp.x64.Targets(514,5): error MSB8008: Specified platform too lset (v140) is not installed or invalid. Please make sure that a supported PlatformToolset value is selected. [D:Projectsangularjsno de_modulesutf-8-validatebuildvalidation.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:WindowsMicrosoft.NETFrameworkv4.0.30319msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:Program Filesnodejsnode_modulesnpmnode_modulesnode-gyplibbuild.js:270:23)
gyp ERR! stack     at emitTwo (events.js:100:13)
gyp ERR! stack     at ChildProcess.emit (events.js:185:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd D:Projectsangularjsnode_modulesutf-8-validate
gyp ERR! node -v v5.5.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok

确保您满足此处列出的所有步骤 https://github.com/Microsoft/nodejs-guidelines/blob/master/windows-environment.md#prerequisites

之后,如果仍然不起作用,请尝试

node-gyp configure --msvs_version=2015
or the npm example
npm install --msvs_version=2015

最新更新