npm install orientjs fatal error. where is node_version.h?

百般思念 提交于 2019-12-11 07:37:23

问题


i wanna use orientjs in below environment.

  • windows 10 pro 64bit
  • node v6.9.2
  • node-gyp v3.4.0
  • orientjs 2.2.4

1) install "windows-build-tools"

$ npm install --global --production windows-build-tools

...ok...

2) install "orientjs"

but, i meet fatal error. where is node_version.h? help me.

$ npm install orientjs --save
npm WARN deprecated node-uuid@1.4.7: use uuid module instead

> orientjs-native@2.2.2 install C:\test1\node_modules\orientjs-native
> node-gyp rebuild


kt@KT-HOME C:\test1\node_modules\orientjs-native
$ if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
  deserializer.cc
  orientc_reader.cpp
  orientc_writer.cpp
  listener.cc

C:\test1\node_modules\nan\nan.h(23): fatal error C1083: Cannot open include file: 'node_version.h': No such file or d irectory (compiling source file ..\lib\native\listener.cc) [C:\test1\node_modules\orientjs-native\build\deserializer. vcxproj]

C:\test1\node_modules\nan\nan.h(23): fatal error C1083: Cannot open include file: 'node_version.h': No such file or d irectory (compiling source file ..\lib\native\deserializer.cc) [C:\test1\node_modules\orientjs-native\build\deseriali zer.vcxproj]

  writer.cc
  helpers.cpp
C:\test1\node_modules\nan\nan.h(23): fatal error C1083: Cannot open include file: 'node_version.h': No such file or d irectory (compiling source file ..\lib\native\writer.cc) [C:\test1\node_modules\orientjs-native\build\deserializer.vc xproj]
  parse_exception.cpp
  win_delay_load_hook.cc
..\lib\native\orientc_reader.cpp(38): warning C4244: 'argument': conversion from 'int64_t' to 'int', possible loss of  data [C:\test1\node_modules\orientjs-native\build\deserializer.vcxproj]
..\lib\native\orientc_reader.cpp(47): warning C4244: 'argument': conversion from 'int64_t' to 'int', possible loss of  data [C:\test1\node_modules\orientjs-native\build\deserializer.vcxproj]
..\lib\native\orientc_reader.cpp(81): warning C4244: 'argument': conversion from 'int64_t' to 'long', possible loss o f data [C:\test1\node_modules\orientjs-native\build\deserializer.vcxproj]
..\lib\native\orientc_reader.cpp(91): warning C4244: 'argument': conversion from 'int64_t' to 'short', possible loss
of data [C:\test1\node_modules\orientjs-native\build\deserializer.vcxproj]
..\lib\native\orientc_reader.cpp(146): warning C4244: 'argument': conversion from 'int64_t' to 'int', possible loss o f data [C:\test1\node_modules\orientjs-native\build\deserializer.vcxproj]
..\lib\native\orientc_reader.cpp(147): warning C4244: 'argument': conversion from 'int64_t' to 'int', possible loss o f data [C:\test1\node_modules\orientjs-native\build\deserializer.vcxproj]
..\lib\native\orientc_reader.cpp(189): warning C4244: 'argument': conversion from 'int64_t' to 'int', possible loss o f data [C:\test1\node_modules\orientjs-native\build\deserializer.vcxproj]
..\lib\native\orientc_reader.cpp(198): warning C4244: '=': conversion from 'int64_t' to 'long', possible loss of data  [C:\test1\node_modules\orientjs-native\build\deserializer.vcxproj]
..\lib\native\orientc_reader.cpp(207): warning C4244: 'initializing': conversion from 'int64_t' to 'int', possible lo ss of data [C:\test1\node_modules\orientjs-native\build\deserializer.vcxproj]
..\lib\native\orientc_reader.cpp(217): warning C4244: 'initializing': conversion from 'int64_t' to 'int', possible lo ss of data [C:\test1\node_modules\orientjs-native\build\deserializer.vcxproj]
..\lib\native\orientc_reader.cpp(237): warning C4244: 'argument': conversion from 'int64_t' to 'int', possible loss o f data [C:\test1\node_modules\orientjs-native\build\deserializer.vcxproj]
..\lib\native\orientc_reader.cpp(242): warning C4244: 'initializing': conversion from 'int64_t' to 'int', possible lo ss of data [C:\test1\node_modules\orientjs-native\build\deserializer.vcxproj]
..\lib\native\orientc_reader.cpp(266): warning C4244: 'argument': conversion from 'int64_t' to 'int', possible loss o f data [C:\test1\node_modules\orientjs-native\build\deserializer.vcxproj]
..\lib\native\orientc_reader.cpp(270): warning C4244: 'initializing': conversion from 'int64_t' to 'int', possible lo ss of data [C:\test1\node_modules\orientjs-native\build\deserializer.vcxproj]
..\lib\native\orientc_writer.cpp(267): warning C4244: 'argument': conversion from 'long' to 'int16_t', possible loss
of data [C:\test1\node_modules\orientjs-native\build\deserializer.vcxproj]
..\lib\native\orientc_writer.cpp(348): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible los s of data [C:\test1\node_modules\orientjs-native\build\deserializer.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.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:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Windows_NT 10.0.14393
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:\test1\node_modules\orientjs-native
gyp ERR! node -v v6.9.2
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
test1@1.0.0 C:\test1
`-- orientjs@2.2.4
  +-- bluebird@2.9.34
  +-- fast.js@0.1.1
  +-- node-biginteger@0.0.10
  | +-- clone@0.2.0
  | `-- long@2.1.0
  +-- parse-function@2.3.2
  | +-- acorn@3.3.0
  | `-- define-property@0.2.5
  |   `-- is-descriptor@0.1.5
  |     +-- is-accessor-descriptor@0.1.6
  |     +-- is-data-descriptor@0.1.4
  |     +-- kind-of@3.1.0
  |     | `-- is-buffer@1.1.4
  |     `-- lazy-cache@2.0.2
  |       `-- set-getter@0.1.0
  |         `-- to-object-path@0.3.0
  +-- request@2.60.0
  | +-- aws-sign2@0.5.0
  | +-- bl@1.0.3
  | | `-- readable-stream@2.0.6
  | |   +-- core-util-is@1.0.2
  | |   +-- inherits@2.0.3
  | |   +-- isarray@1.0.0
  | |   +-- process-nextick-args@1.0.7
  | |   +-- string_decoder@0.10.31
  | |   `-- util-deprecate@1.0.2
  | +-- caseless@0.11.0
  | +-- combined-stream@1.0.5
  | | `-- delayed-stream@1.0.0
  | +-- extend@3.0.0
  | +-- forever-agent@0.6.1
  | +-- form-data@1.0.1
  | | `-- async@2.1.5
  | |   `-- lodash@4.17.4
  | +-- har-validator@1.8.0
  | | +-- chalk@1.1.3
  | | | +-- ansi-styles@2.2.1
  | | | +-- escape-string-regexp@1.0.5
  | | | +-- has-ansi@2.0.0
  | | | | `-- ansi-regex@2.1.1
  | | | +-- strip-ansi@3.0.1
  | | | `-- supports-color@2.0.0
  | | +-- commander@2.9.0
  | | | `-- graceful-readlink@1.0.1
  | | `-- is-my-json-valid@2.16.0
  | |   +-- generate-function@2.0.0
  | |   +-- generate-object-property@1.2.0
  | |   | `-- is-property@1.0.2
  | |   +-- jsonpointer@4.0.1
  | |   `-- xtend@4.0.1
  | +-- hawk@3.1.3
  | | +-- boom@2.10.1
  | | +-- cryptiles@2.0.5
  | | +-- hoek@2.16.3
  | | `-- sntp@1.0.9
  | +-- http-signature@0.11.0
  | | +-- asn1@0.1.11
  | | +-- assert-plus@0.1.5
  | | `-- ctype@0.5.3
  | +-- isstream@0.1.2
  | +-- json-stringify-safe@5.0.1
  | +-- mime-types@2.1.14
  | | `-- mime-db@1.26.0
  | +-- node-uuid@1.4.7
  | +-- oauth-sign@0.8.2
  | +-- qs@4.0.0
  | +-- stringstream@0.0.5
  | +-- tough-cookie@2.3.2
  | | `-- punycode@1.4.1
  | `-- tunnel-agent@0.4.3
  `-- yargs@1.2.6
    `-- minimist@0.1.0

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: orientjs-native@2.2.2 (node_modules\orientjs-native):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: orientjs-native@2.2.2 install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

回答1:


In my case the problem was in the non-latin (cyrillic in my case) characters in the path to my user folder (actually I had cyrillic user name). Try to create new user with latin-only characters in its name and check if you have any non-latin characters in other sensible paths.



来源:https://stackoverflow.com/questions/42602861/npm-install-orientjs-fatal-error-where-is-node-version-h

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!