Caver-js 패키지 구성관련하여 문의드립니다

안녕하세요. caver-js를 가지고 Governence 관련하여 테스트를 진행하려고 합니다

로컬 개발환경은 MacOS이고 Finder에서 폴더를 새로 만들었습니다.
VSCode를 이용하여 해당 경로로 이동하여 caver-js를 설치하려고 하는데 에러가 발생하면서 설치가 안되는거 같습니다.

그때 발생한 로그는

npm init
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.

See `npm help init` for definitive documentation on these fields
and exactly what they do.

Use `npm install <pkg>` afterwards to install a package and
save it as a dependency in the package.json file.

Press ^C at any time to quit.
package name: (daoexample) 
version: (1.0.0) 
description: DAO Example
entry point: (index.js) 
test command: 
git repository: 
keywords: 
author: 
license: (ISC) 
About to write to /Users/work/DAOExample/package.json:

{
  "name": "daoexample",
  "version": "1.0.0",
  "description": "DAO Example",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC"
}


Is this OK? (yes) yes
work-MacBookPro:DAOExample work$ npm install caver-js
npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
npm WARN deprecated multiaddr-to-uri@6.0.0: This module is deprecated, please upgrade to @multiformats/multiaddr-to-uri
npm WARN deprecated ipld-raw@6.0.0: This module has been superseded by the multiformats module
npm WARN deprecated cids@1.1.9: This module has been superseded by the multiformats module
npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /Users/work/.npm/_cacache/content-v2/sha512/3d/15
npm ERR! errno -13
npm ERR! 
npm ERR! Your cache folder contains root-owned files, due to a bug in
npm ERR! previous versions of npm which has since been addressed.
npm ERR! 
npm ERR! To permanently fix this problem, please run:
npm ERR!   sudo chown -R 501:20 "/Users/work/.npm"

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/work/.npm/_logs/2023-05-24T05_25_28_148Z-debug-0.log
work-MacBookPro:DAOExample work$ npm install -g @haechi-labs/vvisp
npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /Users/work/.npm/_cacache/content-v2/sha512/cc/ce
npm ERR! errno EACCES
npm ERR! 
npm ERR! Your cache folder contains root-owned files, due to a bug in
npm ERR! previous versions of npm which has since been addressed.
npm ERR! 
npm ERR! To permanently fix this problem, please run:
npm ERR!   sudo chown -R 501:20 "/Users/work/.npm"

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/work/.npm/_logs/2023-05-24T05_26_23_105Z-debug-0.log

이렇게 발생했습니다

참고사이트를 통해서 실행했는데 어떤 부분이 잘못되었는지 잘 모르겠네요 ㅜㅜ

안녕하세요 해당 에러는 "/Users/work/.npm"경로에 권한이 없어서 발생하는 문제로 보여집니다.

로그에서 안내하는 대로 sudo chown -R 501:20 "/Users/work/.npm" 명령을 한번 수행해보시고 다시 설치를 진행해보시기 바랍니다.

@jack_jin

added 88 packages, removed 104 packages, changed 56 packages, and audited 315 packages in 15s

67 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

이런 로그가 남으면 정상적인 설치로 생각하고 다음 명령어를 실행했는데

npm install -g @haechi-labs/vvisp
npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /usr/local/lib/node_modules/@haechi-labs
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/@haechi-labs'
npm ERR!  [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/@haechi-labs'] {
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'mkdir',
npm ERR!   path: '/usr/local/lib/node_modules/@haechi-labs'
npm ERR! }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/work/.npm/_logs/2023-05-24T06_12_42_894Z-debug-0.log

이런 오류가 발생하네요…?
sudo를 붙여서 하면

npm WARN deprecated mkdirp-promise@5.0.1: This package is broken and no longer maintained. 'mkdirp' itself supports promises now, please switch to that.
npm WARN deprecated fs-promise@2.0.3: Use mz or fs-extra^3.0 with Promise Support
npm WARN deprecated tar.gz@1.0.7: ⚠️  WARNING ⚠️ tar.gz module has been deprecated and your application is vulnerable. Please use tar module instead: https://npmjs.com/tar
npm WARN deprecated har-validator@5.0.3: this library is no longer supported
npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated uuid@2.0.1: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated request@2.87.0: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated request-promise@4.2.6: request-promise has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated rollup-plugin-babel@3.0.7: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-babel.
npm WARN deprecated @babel/polyfill@7.12.1: 🚨 This package has been deprecated in favor of separate inclusion of a polyfill and regenerator-runtime (when needed). See the @babel/polyfill docs (https://babeljs.io/docs/en/babel-polyfill) for more information.
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated ethereumjs-tx@1.3.7: New package name format for new versions: @ethereumjs/tx. Please update.
npm WARN deprecated core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
npm ERR! code 1
npm ERR! path /usr/local/lib/node_modules/@haechi-labs/vvisp/node_modules/sha3
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! CXX(target) Release/obj.target/sha3/src/addon.o
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.3.1
npm ERR! gyp info using node@18.14.0 | darwin | x64
npm ERR! gyp info find Python using Python version 3.7.3 found at "/Library/Developer/CommandLineTools/usr/bin/python3"
npm ERR! gyp info spawn /Library/Developer/CommandLineTools/usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/usr/local/lib/node_modules/@haechi-labs/vvisp/node_modules/sha3/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/work/Library/Caches/node-gyp/18.14.0/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/Users/work/Library/Caches/node-gyp/18.14.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/Users/work/Library/Caches/node-gyp/18.14.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/usr/local/lib/node_modules/@haechi-labs/vvisp/node_modules/sha3',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.
npm ERR! No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.
npm ERR! No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.
npm ERR! 
npm ERR! 
npm ERR! 
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! In file included from ../src/addon.cpp:4:
npm ERR! ../node_modules/nan/nan.h:2470:8: warning: 'SetAccessor' is deprecated: Do signature check in accessor [-Wdeprecated-declarations]
npm ERR!   tpl->SetAccessor(
npm ERR!        ^
npm ERR! /Users/work/Library/Caches/node-gyp/18.14.0/include/node/v8-template.h:837:3: note: 'SetAccessor' has been explicitly marked deprecated here
npm ERR!   V8_DEPRECATED("Do signature check in accessor")
npm ERR!   ^
npm ERR! /Users/work/Library/Caches/node-gyp/18.14.0/include/node/v8config.h:460:35: note: expanded from macro 'V8_DEPRECATED'
npm ERR! # define V8_DEPRECATED(message) [[deprecated(message)]]
npm ERR!                                   ^
npm ERR! In file included from ../src/addon.cpp:4:
npm ERR! In file included from ../node_modules/nan/nan.h:2818:
npm ERR! ../node_modules/nan/nan_typedarray_contents.h:34:43: error: no member named 'GetContents' in 'v8::ArrayBuffer'
npm ERR!       data   = static_cast<char*>(buffer->GetContents().Data()) + byte_offset;
npm ERR!                                   ~~~~~~  ^
npm ERR! In file included from ../src/addon.cpp:9:
npm ERR! In file included from ../src/KeccakNISTInterface.h:17:
npm ERR! ../src/KeccakSponge.h:23:9: warning: 'ALIGN' macro redefined [-Wmacro-redefined]
npm ERR! #define ALIGN __attribute__ ((aligned(32)))
npm ERR!         ^
npm ERR! /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/i386/param.h:83:9: note: previous definition is here
npm ERR! #define ALIGN(p)        __DARWIN_ALIGN(p)
npm ERR!         ^
npm ERR! 2 warnings and 1 error generated.
npm ERR! make: *** [Release/obj.target/sha3/src/addon.o] Error 1
npm ERR! gyp ERR! build error 
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:203:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Darwin 22.4.0
npm ERR! gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /usr/local/lib/node_modules/@haechi-labs/vvisp/node_modules/sha3
npm ERR! gyp ERR! node -v v18.14.0
npm ERR! gyp ERR! node-gyp -v v9.3.1
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/work/.npm/_logs/2023-05-24T06_13_30_683Z-debug-0.log

이렇게 오류가 발생했습니다…