0

I'm trying to install the dependencies for our project on my Windows machine using npm install and I'm getting the following error details:

detect-character-encoding@0.7.0 install C:\dev\...\node_modules\detect-character-encoding 
node-gyp rebuild
...
 [C:\dev\...\node_modules\detect-character-encoding\build\xyz.vcxproj]
  c:\users\[User]\.node-gyp\10.16.0\include\node\v8.h(10046): note: see declaration of 'v8::Value::ToObject'
     Creating library C:\dev\...\node_modules\detect-character-encoding\build\Release\xyz.lib and object C:\dev\...\node_modules\detect-character-encoding\build\Release\xyz.exp
icui18n.lib(csmatch.obj) : error LNK2001: unresolved external symbol ucnv_close_61 [C:\dev\...\node_modules\detect-character-encoding\build\xyz.vcxproj]
icui18n.lib(csmatch.obj) : error LNK2001: unresolved external symbol ucnv_toUChars_61 [C:\dev\...\node_modules\detect-character-encoding\build\xyz.vcxproj]
icui18n.lib(csmatch.obj) : error LNK2001: unresolved external symbol ucnv_open_61 [C:\dev\...\node_modules\detect-character-encoding\build\xyz.vcxproj]
icuucx.lib(uenum.obj) : error LNK2001: unresolved external symbol u_UCharsToChars_61 [C:\dev\...\node_modules\detect-character-encoding\build\xyz.vcxproj]
icuucx.lib(uenum.obj) : error LNK2001: unresolved external symbol u_charsToUChars_61 [C:\dev\...\node_modules\detect-character-encoding\build\xyz.vcxproj]
icuucx.lib(ucln_cmn.obj) : error LNK2001: unresolved external symbol utrace_cleanup_61 [C:\dev\...\node_modules\detect-character-encoding\build\xyz.vcxproj]
C:\dev\...\node_modules\detect-character-encoding\build\Release\xyz.node : fatal error LNK1120: 6 unresolved externals [C:\dev\...\node_modules\detect-character-encoding\build\xyz.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Windows_NT 10.0.17763
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 C:\dev\...\node_modules\detect-character-encoding
gyp ERR! node -v v10.16.0
gyp ERR! node-gyp -v v3.8.0

I've tried installing the "missing" files with no luck and I've already installed the build tools. How can I resolve this error?

UPDATE: I've looked at this question here but it is far too generic to help me unless I spend hours to read the answers and try them one at a time.

Jorjani
  • 827
  • 1
  • 16
  • 31
  • @1201ProgramAlarm, you may be able to take a look at the question and understand the problem as a C++ expert. It would take me hours and hours to read through 32 generic answers and write the one that solves my problem. – Jorjani Oct 10 '19 at 14:59
  • What it comes down to is you need to find the symbols that are unresolved (`ucnv_close_61`, `ucnv_toUchars_61`, etc) and include them in the linker. Are they in a different source module (you need to link with it)? Not defined at all (you need to define them)? In a library (you need to tell the linker to look there)? The potential source of this error is very broad, with numerous causes, and what's included in the question gives no indication which of those many causes is the problem here. That's why the duplicate has so many answers, because there are many causes of this problem. – 1201ProgramAlarm Oct 10 '19 at 19:33
  • Thank you for the explanation! For anyone else, I found my answer at https://github.com/sonicdoe/detect-character-encoding/issues/12 . It is because what I need doesn't even support Windows and maybe the libraries don't even exist as of now. I switched back to Linux. – Jorjani Oct 11 '19 at 14:58

0 Answers0