英文:
node_modules/@newrelic/native-metrics: Command failed. node_modules/couchbase: Command failed. Exit code: 127
问题
在2021年的MacBook M1 Pro上,运行Ventura 13.5,我有一个使用TypeScript开发的项目。它使用yarn,并且在执行以下命令时应该正常工作:
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...
> 有关nestjs、eslint、tsloader等的一些警告。
> [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,以及其他许多解决方案,但我找不到解决方法。
英文:
In macbook m1 pro 2021, ventura 13.5 I have a project that I developed in typescript. It uses yarn, it's supposed to work fine when I do
yarn build
yarn install
yarn start
my versions:
`yarn -v
1.22.19`
` npm -v
9.8.1
`
`node -v
v20.5.0
These are the versions and I need to use couchbase version 3.2.1
I think that the problem is with macbook m1 chip, but not sure
when I do yarn build
it gives this output:
> yarn run v1.22.19
> $ rimraf dist
> $ nest build
> DeprecationWarning: blabla
> ✨ Done in 3.73s.
and then I run the command yarn install
but it gives this output and then it blocks me to run yarn start
command:
> 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
I tried this one: https://github.com/tj/n and I tried many other solutions but I couldn't find a solution.
答案1
得分: 2
使用 Node 18,
为了不卸载 Node 20,只需在本地安装 nvm,如何安装
然后像下面这样使用 Node 18
nvm use 18
然后对于其他操作,如 yarn 安装、构建等,执行相同的命令...
英文:
use node 18,
in order to not to uninstall node 20, just install nvm in your local, how to
then use node 18 like follows
nvm use 18
then do same commands for the rest, such as yarn install, build etc...
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论