简体   繁体   English

npm install java: error MSB4019: 未找到导入的项目“D:\\Microsoft.Cpp.Default.props”

[英]npm install java: error MSB4019: The imported project “D:\Microsoft.Cpp.Default.props” was not found

We are trying to use the node java bridge to run a java application..我们正在尝试使用节点 java 桥来运行 java 应用程序..

As mentioned in the requirement we have to install the java in the node project.如要求中所述,我们必须在节点项目中安装java。

so i am running the所以我正在运行

npm install java npm 安装 java

I have already run the below command suggested in many forum like我已经运行了许多论坛中建议的以下命令,例如

npm install --global windows-build-tools
npm install -g nw-gyp

Getting below exception.低于异常。

PS D> npm install java PS D> npm 安装 java

java@0.10.0 install D:\\nodebrigde\\node_modules\\java node-gyp rebuild java@0.10.0 安装 D:\\nodebrigde\\node_modules\\java node-gyp 重建

D:\\nodebrigde\node_modules\java>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\no
de_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Program Files\nodejs\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.
D:\nodebrigde\node_modules\java\build\nodejavabridge_bindings.vcxproj(20,3): error MSB4019: The imported project "D:\Microsoft.Cpp.Default.props" was not found. Co
nfirm that the path in the <Import> declaration is correct, and that the file exists on disk.
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\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:258: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.15063
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 D:\nodebrigde\node_modules\java
gyp ERR! node -v v8.11.3
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! java@0.10.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the java@0.10.0 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\AppData\Roaming\npm-cache\_logs\2018-06-25T10_03_58_299Z-debug.log

If possible please suggest in detail as i am new to angular/node如果可能,请详细提出建议,因为我是 angular/node 的新手

Written initially in March 2020 for windows.最初于 2020 年 3 月为 windows 编写。

  1. Run:跑:

    npm install --global --production windows-build-tools@4.0.0 npm install --global --production windows-build-tools@4.0.0

  2. Add environment variable called "VCTargetsPath" with value of the path to folder of Microsoft.Cpp.Default.props.添加名为“VCTargetsPath”的环境变量,其值为 Microsoft.Cpp.Default.props 文件夹的路径值。 On my computer it is "C:\\Program Files (x86)\\MSBuild\\Microsoft.Cpp\\v4.0\\v140".在我的电脑上,它是“C:\\Program Files (x86)\\MSBuild\\Microsoft.Cpp\\v4.0\\v140”。

  3. try downloading package again再次尝试下载包

=== ===

Edit:编辑:

I have come to know this may be solved by giving node the path to python.我已经知道这可以通过为 node 提供 python 的路径来解决。 (I don't think the version matters?). (我认为版本不重要?)。 Try running:尝试运行:

npm config set python path\to\file\python.exe

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 运行导入的github java eyetracking项目时出错 - error in running imported github java eyetracking project 导入到Eclipse的Maven项目的错误“找不到GWT模块” - Error “No GWT module found” for Maven project imported into Eclipse 无法连接到数据库错误:java.sql.SQLException:[Microsoft] [ODBC驱动程序管理器]找不到数据源名称并且未指定默认驱动程序 - Cannot connect to database Error: java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified 在 Java 项目中使用 npm? - Using npm with a java project? Android Studio 无法运行导入的项目(Error running &#39;app&#39; default activity not found - Android Studio can't run imported projects (Error running 'app' default activity not found 将cpp文件添加到cocos2d-x项目的android项目中 - Adding cpp files to cocos2d-x project android project CMAKE将Java库添加到cpp项目 - CMAKE add java libraries to cpp project 是什么导致 Eclipse 中导入的 Maven 项目默认使用 Java 1.5 而不是 Java 1.6,我如何确保它不会? - What causes imported Maven project in Eclipse to use Java 1.5 instead of Java 1.6 by default and how can I ensure it doesn't? java.sql.SQLException:[Microsoft] [ODBC驱动程序管理器]找不到数据源名称,也没有默认驱动程序 - java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver java.sql.SQLException:[Microsoft] [ODBC驱动程序管理器]找不到数据源名称,未指定默认驱动程序 - java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM