node_modules/@newrelic/native-metrics:命令失败。 node_modules/couchbase:命令失败。退出代码:127

问题描述 投票:0回答:1

在 macbook m1 pro 2021、ventura 13.5 中,我有一个用 typescript 开发的项目。它使用纱线,当我这样做时它应该工作得很好

yarn build

yarn install

yarn start

我的版本:

`yarn -v 
1.22.19`

` npm -v
9.8.1
`

`node -v
v20.5.0

这些是版本,我需要使用 couchbase 版本 3.2.1

我认为问题出在 macbook m1 芯片上,但不确定

当我这样做时

yarn build
它会给出以下输出:

> yarn run v1.22.19
> $ rimraf dist
> $ nest build
> DeprecationWarning: blabla
> ✨  Done in 3.73s.

然后我运行命令

yarn install
但它给出了这个输出,然后它阻止我运行
yarn start
命令:

> yarn install v1.22.19
> [1/4] 🔍  Resolving packages...
> [2/4] 🚚  Fetching packages...
> [3/4] 🔗  Linking dependencies...
> some warnings about nestjs, eslint, tsloader etc.
> [4/4] 🔨  Building fresh packages...
> [6/7] ⠂ @nestjs/core
> [-/7] ⠂ waiting...
> 3/7] ⠂ couchbase
> [-/7] ⠂ waiting...
> warning Error running install script for optional dependency: "/Users/user1/project1/node_modules/@newrelic/native-metrics: Command failed.
> Exit code: 1
> Command: node ./lib/pre-build.js install native_metrics
> Arguments: 
> Directory: /Users/user1/project1/node_modules/@newrelic/native-metrics
> Output:
> ============================================================================
> Attempting install in native-metrics module. Please note that this is an
> OPTIONAL dependency, and any resultant errors in this process will not
> affect the general performance of the New Relic agent, but event loop and
> garbage collection metrics will not be collected.
> ============================================================================
> [6/7] ⡀ @nestjs/core
> [-/7] ⡀ waiting...
> [3/7] ⡀ couchbase
> [-/7] ⡀ waiting...
> error /Users/user1/project1/node_modules/couchbase: Command failed.
> Exit code: 127
> Command: prebuild-install || node-gyp rebuild
> Arguments: 
> Directory: /Users/user1/project1/node_modules/couchbase

我尝试了这个:https://github.com/tj/n并且我尝试了许多其他解决方案,但我找不到解决方案。

typescript nestjs node-modules couchbase newrelic
1个回答
0
投票

使用节点 18,

为了不卸载节点20,只需在本地安装nvm即可,如何

然后使用节点 18,如下所示

nvm use 18

然后对其余部分执行相同的命令,例如yarn install、build 等...

© www.soinside.com 2019 - 2024. All rights reserved.