Having issues with packages

I keep having errors with packages, like featured packages not loading and having errors installing packages.

Here’s the error output of trying to install packages:

node:internal/modules/cjs/loader:479
throw e;
^

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath ‘./bin/npm-cli’ is not defined by “exports” in /usr/lib/node_modules/atom-package-manager/node_modules/npm/package.json
at new NodeError (node:internal/errors:329:5)
at throwExportsNotFound (node:internal/modules/esm/resolve:320:9)
at packageExportsResolve (node:internal/modules/esm/resolve:545:3)
at resolveExports (node:internal/modules/cjs/loader:473:36)
at Function.Module._findPath (node:internal/modules/cjs/loader:513:31)
at Function.node_module._findPath (/usr/lib/node_modules/atom-package-manager/node_modules/asar-require/lib/require.js:141:32)
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:911:27)
at Function.resolve (node:internal/modules/cjs/helpers:98:19)
at new Install (/usr/lib/node_modules/atom-package-manager/lib/install.js:53:34)
at Object.run (/usr/lib/node_modules/atom-package-manager/lib/apm-cli.js:240:18) {
code: ‘ERR_PACKAGE_PATH_NOT_EXPORTED’
}

And here’s the error for featured packages:

/usr/lib/node_modules/atom-package-manager/node_modules/npm/lib/npm.js:130
throw new TypeError(‘must call as: npm.load(callback)’)
^

TypeError: must call as: npm.load(callback)
at Object.load (/usr/lib/node_modules/atom-package-manager/node_modules/npm/lib/npm.js:130:13)
at loadNpm (/usr/lib/node_modules/atom-package-manager/lib/request.js:17:16)
at configureRequest (/usr/lib/node_modules/atom-package-manager/lib/request.js:21:12)
at Object.get (/usr/lib/node_modules/atom-package-manager/lib/request.js:42:14)
at Featured.module.exports.Featured.getFeaturedPackagesByType (/usr/lib/node_modules/atom-package-manager/lib/featured.js:52:22)
at Featured.module.exports.Featured.run (/usr/lib/node_modules/atom-package-manager/lib/featured.js:133:21)
at Object.run (/usr/lib/node_modules/atom-package-manager/lib/apm-cli.js:240:32)
at Object. (/usr/lib/node_modules/atom-package-manager/bin/apm:9:30)
at Module._compile (node:internal/modules/cjs/loader:1108:14)
at Object.Module._extensions…js (node:internal/modules/cjs/loader:1137:10)

I have absolutely the same output trying to install some additional packages.

Same error here. This is the message under “Featured Packages.” I can’t install any packages. I get the same error when trying to search or install with apm install or apm search.

Fetching featured packages failed.Hide output…
/usr/lib/node_modules/npm/lib/npm.js:130
      throw new TypeError('must call as: npm.load(callback)')
      ^

TypeError: must call as: npm.load(callback)
    at Object.load (/usr/lib/node_modules/npm/lib/npm.js:130:13)
    at loadNpm (/usr/lib/node_modules/atom-package-manager/lib/request.js:17:16)
    at configureRequest (/usr/lib/node_modules/atom-package-manager/lib/request.js:21:12)
    at Object.get (/usr/lib/node_modules/atom-package-manager/lib/request.js:42:14)
    at Featured.module.exports.Featured.getFeaturedPackagesByType (/usr/lib/node_modules/atom-package-manager/lib/featured.js:52:22)
    at Featured.module.exports.Featured.getAllFeaturedPackages (/usr/lib/node_modules/atom-package-manager/lib/featured.js:83:19)
    at Featured.module.exports.Featured.run (/usr/lib/node_modules/atom-package-manager/lib/featured.js:135:21)
    at Object.run (/usr/lib/node_modules/atom-package-manager/lib/apm-cli.js:240:32)
    at Object.<anonymous> (/usr/lib/node_modules/atom-package-manager/bin/apm:9:30)
    at Module._compile (node:internal/modules/cjs/loader:1108:14)

Problem persists when starting atom in safe mode and when renaming the .atom directory: mv .atom .atom.bak

I tried to reinstall atom, and the problem persisted.

Confirm problem persisted after reinstall.

My system - Arch Linux, Atom version 1.54.0 x64

It seems to be a bug of npm v.7

> This is caused by an API change in NPM CLI. npm.load now only accepts a callback in the latest version. I’m not sure why this API change was made. This change wasn’t present in npm version 6.14.11, it was introduced shortly after that version.

This fixed the problem for me: https://github.com/atom/atom/issues/21970

I already did that, it didn’t work, even removed the config and cache files.