yarn 으로 package 를 설치하는데 에러가 발생했다

 

에러 전문

Progress: resolved 763, reused 737, downloaded 0, added 739, done
node_modules/.pnpm/node-sass@9.0.0/node_modules/node-sass: Running install script, done in 260ms
node_modules/.pnpm/node-sass@9.0.0/node_modules/node-sass: Running postinstall script, failed in 366ms
.../node_modules/node-sass postinstall$ node scripts/build.js
│ Binary found at /Users/mik_a/Desktop/dev/ezerp/node_modules/.pnpm/node-sass@9.0.0/node_modules/node-sass/vendor/darwin-arm64-108/binding.node
│ Testing binary
│ Binary has a problem: Error: dlopen(/Users/mik_a/Desktop/dev/ezerp/node_modules/.pnpm/node-sass@9.0.0/node_modules/node-sass/vendor/darwin-arm64-108/binding.node, 0x0001): tried: '/Users/mik_a/Desktop/dev/ezerp/node_modules/.pnpm/node-sa…
│     at Module._extensions..node (node:internal/modules/cjs/loader:1338:18)
│     at Module.load (node:internal/modules/cjs/loader:1117:32)
│     at Module._load (node:internal/modules/cjs/loader:958:12)
│     at Module.require (node:internal/modules/cjs/loader:1141:19)
│     at require (node:internal/modules/cjs/helpers:110:18)
│     at module.exports (/Users/mik_a/Desktop/dev/ezerp/node_modules/.pnpm/node-sass@9.0.0/node_modules/node-sass/lib/binding.js:19:10)
│     at Object.<anonymous> (/Users/mik_a/Desktop/dev/ezerp/node_modules/.pnpm/node-sass@9.0.0/node_modules/node-sass/lib/index.js:13:35)
│     at Module._compile (node:internal/modules/cjs/loader:1254:14)
│     at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
│     at Module.load (node:internal/modules/cjs/loader:1117:32) {
│   code: 'ERR_DLOPEN_FAILED'
│ }
│ Building the binary locally
│ Building: /usr/local/bin/node /Users/mik_a/Desktop/dev/ezerp/node_modules/.pnpm/node-gyp@8.4.1/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
│ gyp info it worked if it ends with ok
│ gyp verb cli [
│ gyp verb cli   '/usr/local/bin/node',
│ gyp verb cli   '/Users/mik_a/Desktop/dev/ezerp/node_modules/.pnpm/node-gyp@8.4.1/node_modules/node-gyp/bin/node-gyp.js',
│ gyp verb cli   'rebuild',
│ gyp verb cli   '--verbose',
│ gyp verb cli   '--libsass_ext=',
│ gyp verb cli   '--libsass_cflags=',
│ gyp verb cli   '--libsass_ldflags=',
│ gyp verb cli   '--libsass_library='
│ gyp verb cli ]
│ gyp info using node-gyp@8.4.1
│ gyp info using node@18.16.0 | darwin | arm64
│ gyp verb command rebuild []
│ gyp verb command clean []
│ gyp verb clean removing "build" directory
│ gyp verb command configure []
│ gyp verb find Python Python is not set from command line or npm configuration
│ gyp verb find Python Python is not set from environment variable PYTHON
│ gyp verb find Python checking if "python3" can be used
│ gyp verb find Python - executing "python3" to get executable path
│ gyp verb find Python - executable path is "/Library/Frameworks/Python.framework/Versions/3.12/bin/python3"
│ gyp verb find Python - executing "/Library/Frameworks/Python.framework/Versions/3.12/bin/python3" to get version
│ gyp verb find Python - version is "3.12.2"
│ gyp info find Python using Python version 3.12.2 found at "/Library/Frameworks/Python.framework/Versions/3.12/bin/python3"
│ gyp verb get node dir no --target version specified, falling back to host node version: 18.16.0
│ gyp verb command install [ '18.16.0' ]
│ gyp verb install input version string "18.16.0"
│ gyp verb install installing version: 18.16.0
│ gyp verb install --ensure was passed, so won't reinstall if already installed
│ gyp verb install version is already installed, need to check "installVersion"
│ gyp verb got "installVersion" 11
│ gyp verb needs "installVersion" 9
│ gyp verb install version is good
│ gyp verb get node dir target node version installed: 18.16.0
│ gyp verb build dir attempting to create "build" dir: /Users/mik_a/Desktop/dev/ezerp/node_modules/.pnpm/node-sass@9.0.0/node_modules/node-sass/build
│ gyp verb build dir "build" dir needed to be created? Yes
│ gyp verb build/config.gypi creating config file
│ gyp verb build/config.gypi writing out config file: /Users/mik_a/Desktop/dev/ezerp/node_modules/.pnpm/node-sass@9.0.0/node_modules/node-sass/build/config.gypi
│ gyp verb config.gypi checking for gypi file: /Users/mik_a/Desktop/dev/ezerp/node_modules/.pnpm/node-sass@9.0.0/node_modules/node-sass/config.gypi
│ gyp verb common.gypi checking for gypi file: /Users/mik_a/Desktop/dev/ezerp/node_modules/.pnpm/node-sass@9.0.0/node_modules/node-sass/common.gypi
│ gyp verb gyp gyp format was not specified; forcing "make"
│ gyp info spawn /Library/Frameworks/Python.framework/Versions/3.12/bin/python3
│ gyp info spawn args [
│ gyp info spawn args   '/Users/mik_a/Desktop/dev/ezerp/node_modules/.pnpm/node-gyp@8.4.1/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/mik_a/Desktop/dev/ezerp/node_modules/.pnpm/node-sass@9.0.0/node_modules/node-sass/build/config.gypi',
│ gyp info spawn args   '-I',
│ gyp info spawn args   '/Users/mik_a/Desktop/dev/ezerp/node_modules/.pnpm/node-gyp@8.4.1/node_modules/node-gyp/addon.gypi',
│ gyp info spawn args   '-I',
│ gyp info spawn args   '/Users/mik_a/Library/Caches/node-gyp/18.16.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/mik_a/Library/Caches/node-gyp/18.16.0',
│ gyp info spawn args   '-Dnode_gyp_dir=/Users/mik_a/Desktop/dev/ezerp/node_modules/.pnpm/node-gyp@8.4.1/node_modules/node-gyp',
│ gyp info spawn args   '-Dnode_lib_file=/Users/mik_a/Library/Caches/node-gyp/18.16.0/<(target_arch)/node.lib',
│ gyp info spawn args   '-Dmodule_root_dir=/Users/mik_a/Desktop/dev/ezerp/node_modules/.pnpm/node-sass@9.0.0/node_modules/node-sass',
│ 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 ]
│ Traceback (most recent call last):
│   File "/Users/mik_a/Desktop/dev/ezerp/node_modules/.pnpm/node-gyp@8.4.1/node_modules/node-gyp/gyp/gyp_main.py", line 42, in <module>
│     import gyp  # noqa: E402
│     ^^^^^^^^^^
│   File "/Users/mik_a/Desktop/dev/ezerp/node_modules/.pnpm/node-gyp@8.4.1/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 9, in <module>
│     import gyp.input
│   File "/Users/mik_a/Desktop/dev/ezerp/node_modules/.pnpm/node-gyp@8.4.1/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 19, in <module>
│     from distutils.version import StrictVersion
│ ModuleNotFoundError: No module named 'distutils'
│ gyp ERR! configure error 
│ gyp ERR! stack Error: `gyp` failed with exit code: 1
│ gyp ERR! stack     at ChildProcess.onCpExit (/Users/mik_a/Desktop/dev/ezerp/node_modules/.pnpm/node-gyp@8.4.1/node_modules/node-gyp/lib/configure.js:259:16)
│ gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
│ gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:291:12)
│ gyp ERR! System Darwin 22.4.0
│ gyp ERR! command "/usr/local/bin/node" "/Users/mik_a/Desktop/dev/ezerp/node_modules/.pnpm/node-gyp@8.4.1/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_li…
│ gyp ERR! cwd /Users/mik_a/Desktop/dev/ezerp/node_modules/.pnpm/node-sass@9.0.0/node_modules/node-sass
│ gyp ERR! node -v v18.16.0
│ gyp ERR! node-gyp -v v8.4.1
│ gyp ERR! not ok 
│ Build failed with error code: 1
└─ Failed in 366ms at /Users/mik_a/Desktop/dev/ezerp/node_modules/.pnpm/node-sass@9.0.0/node_modules/node-sass
 ELIFECYCLE  Command failed with exit code 1.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

 

 

node-gyp 에서 python 으로 뭔가를 하는가보다.

거기서 distutils 라는 모듈이 없다고 떴다.

 

검색해보니 setuptools 패키지를 업그레이드 하라고 해서 해줬다.

python3 -m pip install --upgrade setuptools

 

 

이후엔 설치가 잘 됐다.

+ Recent posts