I am trying to install the Netlify CLI via sudo npm install netlify-cli -g
on my mac running MacOS Big Sur 11.2.3 and it throws this npm error :
sudo npm install netlify-cli -g 127 ✘
Password:
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated rollup-plugin-inject@3.0.2: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-inject.
> yarn@1.22.10 preinstall /usr/local/lib/node_modules/netlify-cli/node_modules/yarn
> :; (node ./preinstall.js > /dev/null 2>&1 || true)
/usr/local/bin/netlify -> /usr/local/lib/node_modules/netlify-cli/bin/run
/usr/local/bin/ntl -> /usr/local/lib/node_modules/netlify-cli/bin/run
> esbuild@0.8.57 postinstall /usr/local/lib/node_modules/netlify-cli/node_modules/esbuild
> node install.js
Trying to install "esbuild-darwin-64" using npm
Failed to install "esbuild-darwin-64" using npm: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/netlify-cli/node_modules/esbuild/esbuild-lcsaklv44g'
Trying to download "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.8.57.tgz"
/usr/local/lib/node_modules/netlify-cli/node_modules/esbuild/install.js:178
throw e;
^
Error: EACCES: permission denied, open '/usr/local/lib/node_modules/netlify-cli/node_modules/esbuild/bin/esbuild'
at Object.openSync (fs.js:476:3)
at Object.writeFileSync (fs.js:1467:35)
at installBinaryFromPackage (/usr/local/lib/node_modules/netlify-cli/node_modules/esbuild/install.js:42:6)
at processTicksAndRejections (internal/process/task_queues.js:93:5) {
errno: -13,
syscall: 'open',
code: 'EACCES',
path: '/usr/local/lib/node_modules/netlify-cli/node_modules/esbuild/bin/esbuild'
}
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @netlify/traffic-mesh-agent-win32-x64@^0.27.10 (node_modules/netlify-cli/node_modules/@netlify/traffic-mesh-agent/node_modules/@netlify/traffic-mesh-agent-win32-x64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @netlify/traffic-mesh-agent-win32-x64@0.27.10: wanted {"os":"win32","arch":"x64"} (current: {"os":"darwin","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @netlify/traffic-mesh-agent-linux-x64@^0.27.10 (node_modules/netlify-cli/node_modules/@netlify/traffic-mesh-agent/node_modules/@netlify/traffic-mesh-agent-linux-x64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @netlify/traffic-mesh-agent-linux-x64@0.27.10: wanted {"os":"linux","arch":"x64"} (current: {"os":"darwin","arch":"x64"})
npm WARN @octokit/plugin-request-log@1.0.3 requires a peer of @octokit/core@>=3 but none is installed. You must install peer dependencies yourself.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! esbuild@0.8.57 postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the esbuild@0.8.57 postinstall 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/nino-p/.npm/_logs/2021-03-18T15_03_23_690Z-debug.log