node-synonyms
node-synonyms copied to clipboard
Install failed with errors.
I tried to install with npm install node-synonyms -S, it gave me the following errors.
C:\Users\Liu.D.H\Desktop\node>npm install node-synonyms -S
> [email protected] install C:\Users\Liu.D.H\Desktop\node\node_modules\node-word2vec-reader
> node-gyp rebuild
C:\Users\Liu.D.H\Desktop\node\node_modules\node-word2vec-reader>if not defined npm_config_node_gyp (node "C:\Users\Liu.D.H\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\Liu.D.H\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
addon.cc
reader.cc
win_delay_load_hook.cc
c:\users\liu.d.h\desktop\node\node_modules\node-word2vec-reader\app\reader.h : warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file
in Unicode format to prevent data loss (compiling source file ..\app\reader.cc) [C:\Users\Liu.D.H\Desktop\node\node_modules\node-word2vec-reader\build\word2vec.vcxproj]
c:\users\liu.d.h\desktop\node\node_modules\node-word2vec-reader\app\addon.cc(10): fatal error C1083: Cannot open include file: 'nan.h': No such file or directory [C:\Users\Liu.D.H\Desktop\node\nod
e_modules\node-word2vec-reader\build\word2vec.vcxproj]
c:\users\liu.d.h\desktop\node\node_modules\node-word2vec-reader\app\reader.h(11): fatal error C1083: Cannot open include file: 'nan.h': No such file or directory (compiling source file ..\app\read
er.cc) [C:\Users\Liu.D.H\Desktop\node\node_modules\node-word2vec-reader\build\word2vec.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\Liu.D.H\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Liu.D.H\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Liu.D.H\Desktop\node\node_modules\node-word2vec-reader
gyp ERR! node -v v11.0.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Liu.D.H\AppData\Roaming\npm-cache\_logs\2018-11-26T00_53_57_957Z-debug.log
C:\Users\Liu.D.H\Desktop\node>node -v
v11.0.0
C:\Users\Liu.D.H\Desktop\node>npm -v
6.4.1
C:\Users\Liu.D.H\Desktop\node>
I have tried chcp 437/936/65001, but none of these works.
I tried to fix this problem myself.
TL;DR, try to add the following in package.json and install the dependences with yarn.
"resolutions": {
"node-synonyms/node-word2vec-reader": "git+https://github.com/liudonghua123/node-word2vec.git#node10_windows_patch"
}