Установка Npm на M1 Big Sur не удалась - usr/lib/libcurl.dylib (Нет такого файла или каталога)

Пытаюсь клонировать свое веб-приложение для реагирования на новый M1 Mac, но, похоже, не могу пройти мимо этого.

  • Макбук Эйр М1 macOS
  • Биг-Сур 11.4
  • Xcode установлен
  • Пробовал разные версии узлов (nvm)
  • Пробовал устанавливать libcurl через Brew и т.д.

Запуск установки npm:

npm WARN deprecated [email protected]: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future

> [email protected] install /Users/peterstahl/Documents/peepz/node_modules/node-libcurl
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download 
node-pre-gyp WARN Tried to download(404): https://github.com/JCMais/node-libcurl/releases/download/v2.3.3/node_libcurl-v2.3.3-node-v72-darwin-arm64-unknown.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for [email protected] and [email protected] (node-v72 ABI, unknown) (falling back to source compile with node-gyp) 
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/otool-classic: can't open file: /usr/lib/libcurl.dylib (No such file or directory)
gyp: Call to 'otool -D `curl-config --prefix`/lib/libcurl.dylib | sed -n 2p' returned exit status 0 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/Users/peterstahl/.nvm/versions/node/v12.22.1/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Darwin 20.5.0
gyp ERR! command "/Users/peterstahl/.nvm/versions/node/v12.22.1/bin/node" "/Users/peterstahl/.nvm/versions/node/v12.22.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/Users/peterstahl/Documents/peepz/node_modules/node-libcurl/lib/binding/node_libcurl.node" "--module_name=node_libcurl" "--module_path=/Users/peterstahl/Documents/peepz/node_modules/node-libcurl/lib/binding" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v72"
gyp ERR! cwd /Users/peterstahl/Documents/peepz/node_modules/node-libcurl
gyp ERR! node -v v12.22.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/Users/peterstahl/.nvm/versions/node/v12.22.1/bin/node /Users/peterstahl/.nvm/versions/node/v12.22.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/peterstahl/Documents/peepz/node_modules/node-libcurl/lib/binding/node_libcurl.node --module_name=node_libcurl --module_path=/Users/peterstahl/Documents/peepz/node_modules/node-libcurl/lib/binding --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/peterstahl/Documents/peepz/node_modules/node-libcurl/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1022:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
node-pre-gyp ERR! System Darwin 20.5.0
node-pre-gyp ERR! command "/Users/peterstahl/.nvm/versions/node/v12.22.1/bin/node" "/Users/peterstahl/Documents/peepz/node_modules/node-libcurl/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/peterstahl/Documents/peepz/node_modules/node-libcurl
node-pre-gyp ERR! node -v v12.22.1
node-pre-gyp ERR! node-pre-gyp -v v0.15.0
node-pre-gyp ERR! not ok 
Failed to execute '/Users/peterstahl/.nvm/versions/node/v12.22.1/bin/node /Users/peterstahl/.nvm/versions/node/v12.22.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/peterstahl/Documents/peepz/node_modules/node-libcurl/lib/binding/node_libcurl.node --module_name=node_libcurl --module_path=/Users/peterstahl/Documents/peepz/node_modules/node-libcurl/lib/binding --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
npm WARN @babel/[email protected] requires a peer of @babel/core@^7.13.0 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/[email protected] requires a peer of @babel/core@^7.12.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] 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!     /Users/peterstahl/.npm/_logs/2021-06-24T06_04_49_403Z-debug.log

person Stahl    schedule 24.06.2021    source источник


Ответы (1)


Я видел ту же проблему на своем Mac, просто используйте эту команду в корневой папке вашего проекта, чтобы решить

sudo npm cache clean -f
sudo npm install -g n
sudo n stable
sudo npm install --unsafe-perm=true --allow-root
person Jain Bhavesh    schedule 24.06.2021
comment
Нет успеха, unf :( Спасибо за ввод - person Stahl; 24.06.2021
comment
У меня работает, я использовал самую новую версию node. Спасибо - person mateonunez; 29.07.2021