节点版本:18.19.0; pnpm 转换:9.2.0; 但是当我执行“pnpm i”时安装总是失败,我该如何修复这个错误
WARN 7 deprecated subdependencies found: @types/[email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
Packages: +1878
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 1943, reused 1880, downloaded 0, added 0, done
node_modules/.pnpm/[email protected][email protected]/node_modules/canvas: Running install script...
node_modules/.pnpm/[email protected]/node_modules/isolated-vm: Running install script, failed in 5.1s
.../node_modules/isolated-vm install$ prebuild-install || (node-gyp rebuild --release -j max && node-gyp clean)
│ prebuild-install warn install No prebuilt binaries found (target=18.19.0 runtime=node arch=arm64 libc= platform=darwin)
│ gyp info it worked if it ends with ok
│ gyp info using [email protected]
│ gyp info using [email protected] | darwin | arm64
│ gyp info find Python using Python version 3.12.4 found at "/usr/local/bin/python3"
│ gyp info spawn /usr/local/bin/python3
│ gyp info spawn args [
│ gyp info spawn args '/Users/muyi/.nvm/versions/node/v18.19.0/lib/node_modules/pnpm/dist/node_modules/node-gyp/gyp/gyp_main.py',
│ gyp info spawn args 'binding.gyp',
│ gyp info spawn args '-f',
│ gyp info spawn args 'make',
│ gyp info spawn args '-I',
│ gyp info spawn args '/Users/muyi/Desktop/工作/AIGC/雅典娜ai问答/athena/node_modules/.pnpm/[email protected]/node_modules/isolated-vm/build/config.gypi',
│ gyp info spawn args '-I',
│ gyp info spawn args '/Users/muyi/.nvm/versions/node/v18.19.0/lib/node_modules/pnpm/dist/node_modules/node-gyp/addon.gypi',
│ gyp info spawn args '-I',
│ gyp info spawn args '/Users/muyi/Library/Caches/node-gyp/18.19.0/include/node/common.gypi',
│ gyp info spawn args '-Dlibrary=shared_library',
│ gyp info spawn args '-Dvisibility=default',
│ gyp info spawn args '-Dnode_root_dir=/Users/muyi/Library/Caches/node-gyp/18.19.0',
│ gyp info spawn args '-Dnode_gyp_dir=/Users/muyi/.nvm/versions/node/v18.19.0/lib/node_modules/pnpm/dist/node_modules/node-gyp',
│ gyp info spawn args '-Dnode_lib_file=/Users/muyi/Library/Caches/node-gyp/18.19.0/<(target_arch)/node.lib',
│ gyp info spawn args '-Dmodule_root_dir=/Users/muyi/Desktop/工作/AIGC/雅典娜ai问答/athena/node_modules/.pnpm/[email protected]/node_modules/isolated-vm',
│ gyp info spawn args '-Dnode_engine=v8',
│ gyp info spawn args '--depth=.',
│ gyp info spawn args '--no-parallel',
│ gyp info spawn args '--generator-output',
│ gyp info spawn args 'build',
│ gyp info spawn args '-Goutput_dir=.'
│ gyp info spawn args ]
│ gyp info spawn make
│ gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build', '--jobs', 10 ]
│ sh: line 1: 17407 Bus error: 10 /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk '' -find make 2> /dev/null
│ make: error: unable to find utility "make", not a developer tool or in PATH
│ gyp ERR! build error
│ gyp ERR! stack Error: `make` failed with exit code: 72
│ gyp ERR! stack at ChildProcess.<anonymous> (/Users/muyi/.nvm/versions/node/v18.19.0/lib/node_modules/pnpm/dist/node_modules/node-gyp/lib/build.js:209:23)
│ gyp ERR! System Darwin 23.5.0
│ gyp ERR! command "/Users/muyi/.nvm/versions/node/v18.19.0/bin/node" "/Users/muyi/.nvm/versions/node/v18.19.0/lib/node_modules/pnpm/dist/node_modules/node-gyp/bin/node-…
│ gyp ERR! cwd /Users/muyi/Desktop/工作/AIGC/雅典娜ai问答/athena/node_modules/.pnpm/[email protected]/node_modules/isolated-vm
│ gyp ERR! node -v v18.19.0
│ gyp ERR! node-gyp -v v10.1.0
│ gyp ERR! not ok
└─ Failed in 5.1s at /Users/muyi/Desktop/工作/AIGC/雅典娜ai问答/athena/node_modules/.pnpm/[email protected]/node_modules/isolated-vm
ELIFECYCLE Command failed with exit code 1.
我一开始尝试安装依赖'node-gyp',但还是失败,当我单独安装isoleted-vm时,和我执行'pnpm i'一样。🥹
尝试执行这些命令来重新安装 xocode-select
// 卸载
rm -rf /Library/Developer/CommandLineTools
// 如果权限不够,加sudo
sudo rm -rf /Library/Developer/CommandLineTools
// 重新安装
xcode-select --install
他们可以为我工作。