【问题标题】:The target "/t:native_metrics" does not exist in the project项目中不存在目标“/t:native_metrics”
【发布时间】:2018-07-25 19:30:35
【问题描述】:

我想在我的项目上安装 newrelic,但我从控制台收到:

node_modules\@newrelic\native-metrics\build\bind ing.sln.metaproj : error MSB4057: The target "/t:native_metrics" does not exist in the project.

在另一台机器上完美运行。如果有人能提供帮助,我真的很感激,我已经从 newrelic https://discuss.newrelic.com/t/newrelic-native-metrics-does-not-install-on-windows-10-from-corrupt-vcxproj/54625/3 尝试过这个

【问题讨论】:

    标签: javascript node.js newrelic


    【解决方案1】:

    这很可能是由于 node-gyp 的版本。对 node-gyp 进行了更改 将/t: 添加到 Windows 机器上的构建目标的 3.7.0 版。 New Relic 用于引导构建的./lib/pre-build.js 文件还将/t: 预先添加到目标,这导致/t:/t:native_metrics 的值被传递给MSBuild,这是无效的。您可以通过安装旧版本的 node-gyp 来解决此问题。根据你的机器上 npm 的设置方式,你可能还需要将 npm_config_node_gyp 环境变量设置为旧版本 node-gyp 的路径,以便它被 New Relic 引导程序拾取。

    【讨论】:

    • 解决方案是删除文件夹 npm、node-gyp 和 npm-cache,然后安装在 Windows 选项 2 github.com/nodejs/node-gyp 上。现在可以了!
    猜你喜欢
    • 2011-06-08
    • 2016-04-17
    • 2014-07-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多