I just got all of these errors when upgrading the CLI:
bitnami@ip-10-0-1-202:/opt/bitnami/ghost$ cd /opt/bitnami/ghost/current
bitnami@ip-10-0-1-202:/opt/bitnami/ghost/current$ sudo npm install ghost-cli
npm WARN deprecated url-regex-safe@2.1.0: Please upgrade to url-regex-safe@v3.0.0+ AND install re2 as an additional dependency in your project via `npm install re2` or `yarn add re2`.
npm WARN deprecated mailgun-js@0.22.0: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
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 bree@6.4.0: bree@7.0.0 drops support for the browser, Node <12.11.0, and removes bthreads entirely. Either upgrade to v7.0.0 or lock your bree version to v6.5.0.
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 debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
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 intl-messageformat-parser@2.1.3: We've written a new parser that's 6x faster and is backwards compatible. Please use @formatjs/icu-messageformat-parser
npm WARN deprecated node-pre-gyp@0.11.0: 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
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 rm not removing /opt/bitnami/ghost/versions/4.24.0/node_modules/.bin/rimraf as it wasn't installed by /opt/bitnami/ghost/versions/4.24.0/node_modules/rimraf
npm WARN rm not removing /opt/bitnami/ghost/versions/4.24.0/node_modules/.bin/escodegen as it wasn't installed by /opt/bitnami/ghost/versions/4.24.0/node_modules/escodegen
npm WARN rm not removing /opt/bitnami/ghost/versions/4.24.0/node_modules/.bin/esgenerate as it wasn't installed by /opt/bitnami/ghost/versions/4.24.0/node_modules/escodegen
npm WARN rm not removing /opt/bitnami/ghost/versions/4.24.0/node_modules/.bin/nopt as it wasn't installed by /opt/bitnami/ghost/versions/4.24.0/node_modules/nopt
npm WARN rm not removing /opt/bitnami/ghost/versions/4.24.0/node_modules/.bin/mkdirp as it wasn't installed by /opt/bitnami/ghost/versions/4.24.0/node_modules/mkdirp
npm WARN rm not removing /opt/bitnami/ghost/versions/4.24.0/node_modules/.bin/esvalidate as it wasn't installed by /opt/bitnami/ghost/versions/4.24.0/node_modules/esprima
npm WARN rm not removing /opt/bitnami/ghost/versions/4.24.0/node_modules/.bin/esparse as it wasn't installed by /opt/bitnami/ghost/versions/4.24.0/node_modules/esprima
npm WARN rm not removing /opt/bitnami/ghost/versions/4.24.0/node_modules/.bin/acorn as it wasn't installed by /opt/bitnami/ghost/versions/4.24.0/node_modules/acorn
> yarn@1.22.15 preinstall /opt/bitnami/ghost/versions/4.24.0/node_modules/yarn
> :; (node ./preinstall.js > /dev/null 2>&1 || true)
> dtrace-provider@0.8.8 install /opt/bitnami/ghost/versions/4.24.0/node_modules/dtrace-provider
> node-gyp rebuild || node suppress-error.js
gyp WARN EACCES current user ("bitnami") does not have permission to access the dev dir "/root/.cache/node-gyp/14.18.2"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/opt/bitnami/ghost/versions/4.24.0/node_modules/dtrace-provider/.node-gyp"
gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/opt/bitnami/ghost/versions/4.24.0/node_modules/dtrace-provider/.node-gyp'
gyp ERR! System Linux 4.19.0-18-cloud-amd64
gyp ERR! command "/opt/bitnami/node/bin/node" "/opt/bitnami/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /opt/bitnami/ghost/versions/4.24.0/node_modules/dtrace-provider
gyp ERR! node -v v14.18.2
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
> sqlite3@5.0.2 install /opt/bitnami/ghost/versions/4.24.0/node_modules/knex-migrator/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build
node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp WARN Pre-built binaries not installable for sqlite3@5.0.2 and node@14.18.2 (node-v83 ABI, glibc) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error EACCES: permission denied, mkdir '/opt/bitnami/ghost/versions/4.24.0/node_modules/knex-migrator/node_modules/sqlite3/lib/binding'
gyp WARN EACCES current user ("bitnami") does not have permission to access the dev dir "/root/.cache/node-gyp/14.18.2"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/opt/bitnami/ghost/versions/4.24.0/node_modules/knex-migrator/node_modules/sqlite3/.node-gyp"
gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/opt/bitnami/ghost/versions/4.24.0/node_modules/knex-migrator/node_modules/sqlite3/.node-gyp'
gyp ERR! System Linux 4.19.0-18-cloud-amd64
gyp ERR! command "/opt/bitnami/node/bin/node" "/opt/bitnami/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/opt/bitnami/ghost/versions/4.24.0/node_modules/knex-migrator/node_modules/sqlite3/lib/binding/napi-v3-linux-x64/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/opt/bitnami/ghost/versions/4.24.0/node_modules/knex-migrator/node_modules/sqlite3/lib/binding/napi-v3-linux-x64" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=3" "--node_napi_label=napi-v3"
gyp ERR! cwd /opt/bitnami/ghost/versions/4.24.0/node_modules/knex-migrator/node_modules/sqlite3
gyp ERR! node -v v14.18.2
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 '/opt/bitnami/node/bin/node /opt/bitnami/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/opt/bitnami/ghost/versions/4.24.0/node_modules/knex-migrator/node_modules/sqlite3/lib/binding/napi-v3-linux-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/opt/bitnami/ghost/versions/4.24.0/node_modules/knex-migrator/node_modules/sqlite3/lib/binding/napi-v3-linux-x64 --napi_version=8 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/opt/bitnami/ghost/versions/4.24.0/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:400:28)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1058:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:293:5)
node-pre-gyp ERR! System Linux 4.19.0-18-cloud-amd64
node-pre-gyp ERR! command "/opt/bitnami/node/bin/node" "/opt/bitnami/ghost/versions/4.24.0/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /opt/bitnami/ghost/versions/4.24.0/node_modules/knex-migrator/node_modules/sqlite3
node-pre-gyp ERR! node -v v14.18.2
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! not ok
Failed to execute '/opt/bitnami/node/bin/node /opt/bitnami/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/opt/bitnami/ghost/versions/4.24.0/node_modules/knex-migrator/node_modules/sqlite3/lib/binding/napi-v3-linux-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/opt/bitnami/ghost/versions/4.24.0/node_modules/knex-migrator/node_modules/sqlite3/lib/binding/napi-v3-linux-x64 --napi_version=8 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
> sharp@0.29.2 install /opt/bitnami/ghost/versions/4.24.0/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
sharp: Installation error: EACCES: permission denied, mkdir '/root/.npm'
sharp: Are you trying to install as a root or sudo user? Try again with the --unsafe-perm flag
sharp: Please see https://sharp.pixelplumbing.com/install for required dependencies
> re2@1.17.2 install /opt/bitnami/ghost/versions/4.24.0/node_modules/re2
> install-from-cache --artifact build/Release/re2.node --host-var RE2_DOWNLOAD_MIRROR --skip-path-var RE2_DOWNLOAD_SKIP_PATH --skip-ver-var RE2_DOWNLOAD_SKIP_VER || npm run rebuild
Trying https://github.com/uhop/node-re2/releases/download/1.17.2/linux-x64-83.br ...
Writing to build/Release/re2.node ...
Trying https://github.com/uhop/node-re2/releases/download/1.17.2/linux-x64-83.gz ...
Writing to build/Release/re2.node ...
Building locally ...
npm ERR! code EACCES
npm ERR! syscall scandir
npm ERR! path /root/.npm/_logs
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 1000:1000 "/root/.npm"
glob error [Error: EACCES: permission denied, scandir '/root/.npm/_logs'] {
errno: -13,
code: 'EACCES',
syscall: 'scandir',
path: '/root/.npm/_logs'
}
> re2@1.17.2 rebuild /opt/bitnami/ghost/versions/4.24.0/node_modules/re2
> node-gyp rebuild
gyp WARN EACCES current user ("bitnami") does not have permission to access the dev dir "/root/.cache/node-gyp/14.18.2"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/opt/bitnami/ghost/versions/4.24.0/node_modules/re2/.node-gyp"
gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/opt/bitnami/ghost/versions/4.24.0/node_modules/re2/.node-gyp'
gyp ERR! System Linux 4.19.0-18-cloud-amd64
gyp ERR! command "/opt/bitnami/node/bin/node" "/opt/bitnami/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /opt/bitnami/ghost/versions/4.24.0/node_modules/re2
gyp ERR! node -v v14.18.2
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! re2@1.17.2 rebuild: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the re2@1.17.2 rebuild script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
(node:3105) UnhandledPromiseRejectionWarning: 243
(Use `node --trace-warnings ...` to show where the warning was created)
(node:3105) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:3105) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN @tryghost/express-dynamic-redirects@0.2.1 requires a peer of express@^4.17.1 but none is installed. You must install peer dependencies yourself.
npm WARN express-brute@1.0.1 requires a peer of express@4.x but none is installed. You must install peer dependencies yourself.
npm WARN express-lazy-router@1.0.4 requires a peer of express@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: sqlite3@5.0.2 (node_modules/knex-migrator/node_modules/sqlite3):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: sqlite3@5.0.2 install: `node-pre-gyp install --fallback-to-build`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: sharp@0.29.2 (node_modules/sharp):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: sharp@0.29.2 install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
+ ghost-cli@1.18.1
added 461 packages from 208 contributors, removed 212 packages, updated 1302 packages and audited 1902 packages in 212.296s
140 packages are looking for funding
run `npm fund` for details
found 32 vulnerabilities (18 moderate, 12 high, 2 critical)
run `npm audit fix` to fix them, or `npm audit` for details