[英]error installing java package using npm Cannot open include file: 'jni.h' No such fi le or directory
I have a problem with npm install java command from Windows cmd.我对来自 Windows ZDFFF0A7FA1A55C8C1A2966C19F64DA 的npm 安装 java命令有疑问。
Path to my include file 'jni.h' is in INCLUDE variable in Windows Environment Variables.我的包含文件“jni.h”的路径位于 Windows 环境变量中的 INCLUDE 变量中。 File 'jni.h' located in C:\Program Files\Java\jdk-15.0.2\include
文件“jni.h”位于 C:\Program Files\Java\jdk-15.0.2\include
INCLUDE variable looks like: C:\Program Files\Java\jdk-15.0.2\include C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include C:\Program Files\Java\jdk-15.0.2\include\win32 INCLUDE variable looks like: C:\Program Files\Java\jdk-15.0.2\include C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include C: \Program Files\Java\jdk-15.0.2\include\win32
Path variable looks like: C:\Program Files\Java\jdk-15.0.2 C:\Program Files (x86)\Windows Kits\8.1 C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\Hostx64\x64 C:\Program Files\Java\jdk-15.0.2\include Path variable looks like: C:\Program Files\Java\jdk-15.0.2 C:\Program Files (x86)\Windows Kits\8.1 C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\ Tools\MSVC\14.28.29333\bin\Hostx64\x64 C:\Program Files\Java\jdk-15.0.2\include
Complete log:完整的日志:
D:\helloworld>npm i java D:\helloworld>npm i java
java@0.12.1 install D:\helloworld\node_modules\java node-gyp rebuild
java@0.12.1 安装 D:\helloworld\node_modules\java node-gyp 重建
D:\helloworld\node_modules\java>if not defined npm_config_node_gyp (node "D:\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "D:\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Projects are built sequentially in this solution. To enable parallel build, add the parameter "-m". java.cpp
javaObject.cpp
javaScope.cpp
methodCallBaton.cpp
D:\helloworld\node_modules\java\src\javaScope.h(5,10): fatal error C1083: Cannot open include file: 'jni.h': No such file or directory (compiling source file ..\src\javaScope.cpp) [D:\helloworld\node_modules\java\build\nodejavabridge_bindings.vcxproj]
D:\helloworld\node_modules\java\src\utils.h(7,10): fatal error C1083: Cannot open include file: 'jni.h': No such file or directory (compiling source file ..\src\methodCallBaton.cpp) [D:\helloworld\node_modules\java\build\nodejavabridge_bindings.vcxproj]
nodeJavaBridge.cpp
utils.cpp
D:\helloworld\node_modules\java\src\java.h(7,10): fatal error C1083: Cannot open include file: 'jni.h': No such file or directory (compiling source file ..\src\java.cpp) [D:\helloworld\node_modules\java\build\nodejavabridge_bindings.vcxproj]
win_delay_load_hook.cc
D:\helloworld\node_modules\java\src\javaObject.h(7,10): fatal error C1083: Cannot open include file: 'jni.h': No such f
ile or directory (compiling source file ..\src\javaObject.cpp) [D:\helloworld\node_modules\java\build\nodejavabridge_bi
ndings.vcxproj]
D:\helloworld\node_modules\java\src\utils.h(7,10): fatal error C1083: Cannot open include file: 'jni.h': No such file or directory (compiling source file ..\src\utils.cpp) [D:\helloworld\node_modules\java\build\nodejavabridge_bindings.vcx
proj]
D:\helloworld\node_modules\java\src\java.h(7,10): fatal error C1083: Cannot open include file: 'jni.h': No such file or directory (compiling source file ..\src\nodeJavaBridge.cpp) [D:\helloworld\node_modules\java\build\nodejavabridge_bind
ings.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (D:\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:314:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "D:\\nodejs\\node.exe" "D:\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\helloworld\node_modules\java
gyp ERR! node -v v12.20.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! java@0.12.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the java@0.12.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Solved by:解决者:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.