Node-gyp: MSB4148: The name of a property stored under the registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0" has zero length

Created on 6 Nov 2018  ·  11Comments  ·  Source: nodejs/node-gyp

  • Node Version: v8.12.0
  • Npm: 6.4.1
  • Platform: Windows 10
  • Compiler: Visual C++ compiler
  • Module: node-usb | restify

Verbose output (from npm or node-gyp):

C:\Users\Glaucia Lemos\Downloads\Downloads\Backup - Comp Glaucia\Palestras\Apresentação - Semana da Mulher - ChatBot\semana-meninas-mulheres-ciencia>npm install

> [email protected] install C:\Users\Glaucia Lemos\Downloads\Downloads\Backup - Comp Glaucia\Palestras\Apresentação - Semana da Mulher - ChatBot\semana-meninas-mulheres-ciencia\node_modules\dtrace-provider
> node-gyp rebuild || node suppress-error.js


C:\Users\Glaucia Lemos\Downloads\Downloads\Backup - Comp Glaucia\Palestras\Apresentação - Semana da Mulher - ChatBot\semana-meninas-mulheres-ciencia\node_modules\dtrace-provider>if not defined npm_config_node_gyp (node "C:\Users\Glaucia Lemos\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Users\Glaucia Lemos\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Compilando os projetos desta solução um de cada vez. Para habilitar o build paralelo, adicione a opção "/m".
MSBUILD : Configuration error MSB4148: O nome de uma propriedade armazenada na chave do Registro "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0" tem comprimento zero.
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\Glaucia Lemos\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Glaucia Lemos\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Glaucia Lemos\Downloads\Downloads\Backup - Comp Glaucia\Palestras\Apresentação - Semana da Mulher - ChatBot\semana-meninas-mulheres-ciencia\node_modules\dtrace-provider
gyp ERR! node -v v8.12.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
added 176 packages from 339 contributors and audited 372 packages in 8.55s
found 0 vulnerabilities

Hi guys! So... I've been while trying to execute node-gyp on my Windows 10. but without success. I've tried everything. Even the suggestion of the @refack here #1144. But no success.
I even install the VS 2015 and VS 2017 as you already said here on the documentation, but failed.

This is the message that appears in my screen:

MSB4148: The name of a property stored under the registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0" has zero length. 

I would like ask your help about it. Once I have been trying to install some packages use node-gyp and I can't continue to develop my projects.
Anyone here already resolve this issue?

screen shot 11-06-18 at 01 00 am

image

All 11 comments

@bzoz I will try to make a uninstall here my VS 2017 and then I will return here if works! ;)

Doesn't worked it! :(

image

AFAICT this looks like a bug in the MSVS install... So maybe also report this issue at https://github.com/Microsoft/msbuild

As a workaround you could try importing this regfile https://gist.github.com/refack/363ee65cb3a9a9c5f59f1977cdbf5fc8

Nice.. I will try first remove the VS 2017 on my machine and then try to install node-gyp without VS 2017. If persists the issue, I will return here to send new updates about it.

p.s.: I will report them about it. Thanks a lot @refack it's a honor talk to you! :)

@refack I uninstalled it everything on my machine here. I have done all the documentation procedures of the node-gyp and the error persists.

I've removed: VS 2017 and all subfolders. Everything.

image

Now I don't know what can be... :(

Well my first guess would be that it has something to do with your locale. You could try to search you registry for this value MSBuildRuntimeVersion for example. It might be in
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\VersõesDeFerramentas ;)

Another thing you can try is to run node-gyp in a Developer Command Prompt for VS 2017 (cmd after running VsDevCmd.bat)

I will try here again and then I will report you! Thanks a lot again! :)

@refack I formatted my computer. I installed the node-gyp, but at the time of knowing the version of it appears this error:

image

Going to close this issue once I formatted my computer and this error disappear.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Yamakaky picture Yamakaky  ·  3Comments

meldsza picture meldsza  ·  3Comments

adrianescat picture adrianescat  ·  3Comments

Flimm picture Flimm  ·  3Comments

gengjiawen picture gengjiawen  ·  3Comments