Issue 1:
Is there an existing issue for this?

I have searched the existing issues

This might be a duplicate of #3021, but the repro is different, and hopefully easier to diagnose.

Current Behavior

npm install --prefix <tmpdir> <package> fails on Mac OS

where <tmpdir> is the result of fs.mkdtempSync(path.join(os.tmpdir(), "repro")

npm ERR! Cannot read property 'spec' of undefined

55 verbose stack TypeError: Cannot read property 'spec' of undefined
55 verbose stack at Arborist.[saveIdealTree] (/Users/nicholg/.npm/g/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:959:62)
55 verbose stack at /Users/nicholg/.npm/g/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:139:39
55 verbose stack at async Arborist.reify (/Users/nicholg/.npm/g/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:135:5)
55 verbose stack at async Install.install (/Users/nicholg/.npm/g/lib/node_modules/npm/lib/install.js:137:5)

0 verbose cli [
0 verbose cli '/usr/local/Cellar/node@14/14.17.0/bin/node',
0 verbose cli '/Users/nicholg/.npm/g/bin/npm',
0 verbose cli 'install',
0 verbose cli '--prefix',
0 verbose cli '/var/folders/pt/zgtgnf1n5sl7_vw3n7dqvm5w0000gn/T/reproXMRg76',
0 verbose cli 'leftpad-i18n'
0 verbose cli ]
1 info using npm@7.13.0
2 info using node@v14.17.0
3 timing npm:load:whichnode Completed in 1ms
4 timing config:load:defaults Completed in 2ms
5 timing config:load:file:/Users/nicholg/.npm/g/lib/node_modules/npm/npmrc Completed in 1ms
6 timing config:load:builtin Completed in 1ms
7 timing config:load:cli Completed in 2ms
8 timing config:load:env Completed in 0ms
9 timing config:load:file:/var/folders/pt/zgtgnf1n5sl7_vw3n7dqvm5w0000gn/T/reproXMRg76/.npmrc Completed in 1ms
10 timing config:load:project Completed in 1ms
11 timing config:load:file:/Users/nicholg/.npmrc Completed in 0ms
12 timing config:load:user Completed in 0ms
13 timing config:load:file:/var/folders/pt/zgtgnf1n5sl7_vw3n7dqvm5w0000gn/T/reproXMRg76/etc/npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:validate Completed in 1ms
16 timing config:load:credentials Completed in 1ms
17 timing config:load:setEnvs Completed in 0ms
18 timing config:load Completed in 8ms
19 timing npm:load:configload Completed in 8ms
20 timing npm:load:setTitle Completed in 3ms
21 timing npm:load:setupLog Completed in 1ms
22 timing npm:load:cleanupLog Completed in 2ms
23 timing npm:load:configScope Completed in 0ms
24 timing npm:load:projectScope Completed in 1ms
25 timing npm:load Completed in 16ms
26 timing config:load:flatten Completed in 2ms
27 timing arborist:ctor Completed in 1ms
28 timing arborist:ctor Completed in 0ms
29 timing idealTree:init Completed in 18ms
30 timing idealTree:userRequests Completed in 2ms
31 silly idealTree buildDeps
32 silly fetch manifest leftpad-i18n@*
33 http fetch GET 304 https://registry.npmjs.org/leftpad-i18n 171ms (from cache)
34 silly placeDep ROOT leftpad-i18n@1.1.0 OK for: want: *
35 timing idealTree:#root Completed in 178ms
36 timing idealTree:node_modules/leftpad-i18n Completed in 0ms
37 timing idealTree:buildDeps Completed in 180ms
38 timing idealTree:fixDepFlags Completed in 0ms
39 timing idealTree Completed in 201ms
40 timing reify:loadTrees Completed in 202ms
41 timing reify:diffTrees Completed in 0ms
42 silly reify moves {}
43 timing reify:retireShallow Completed in 0ms
44 timing reify:createSparse Completed in 0ms
45 timing reify:loadBundles Completed in 0ms
46 silly audit bulk request { 'leftpad-i18n': [ '1.1.0' ] }
47 timing reify:unpack Completed in 0ms
48 timing reify:unretire Completed in 1ms
49 timing build:queue Completed in 0ms
50 timing build:deps Completed in 0ms
51 timing build Completed in 0ms
52 timing reify:build Completed in 0ms
53 timing reify:trash Completed in 0ms
54 timing command:install Completed in 219ms
55 verbose stack TypeError: Cannot read property 'spec' of undefined
55 verbose stack at Arborist.[saveIdealTree] (/Users/nicholg/.npm/g/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:959:62)
55 verbose stack at /Users/nicholg/.npm/g/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:139:39
55 verbose stack at async Arborist.reify (/Users/nicholg/.npm/g/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:135:5)
55 verbose stack at async Install.install (/Users/nicholg/.npm/g/lib/node_modules/npm/lib/install.js:137:5)
56 verbose cwd /Users/nicholg/q
57 verbose Darwin 20.4.0
58 verbose argv "/usr/local/Cellar/node@14/14.17.0/bin/node" "/Users/nicholg/.npm/g/bin/npm" "install" "--prefix" "/var/folders/pt/zgtgnf1n5sl7_vw3n7dqvm5w0000gn/T/reproXMRg76" "leftpad-i18n"
59 verbose node v14.17.0
60 verbose npm v7.13.0
61 error Cannot read property 'spec' of undefined
62 verbose exit 1

Expected Behavior

Installation succeeds as it does if I downgrade to npm 6.x.

Steps To Reproduce

Using environment described below, create a repro.js file with the following:

const { spawnSync } = require("child_process");
const { mkdtempSync } = require("fs");
const { tmpdir } = require("os");
const { join } = require("path");

const dir = mkdtempSync(join(tmpdir(), "repro"));
console.log(`> npm install --prefix ${dir} "leftpad-i18n"\n`);
spawnSync("npm", ["install", "--prefix", dir, "leftpad-i18n" ], {
stdio: "inherit",
});

Then run it:

node repro.js

Environment

OS: mac OS Big Sur 11.3.1

Node: 14.17.0

npm: 7.13.0

Issue 2:
Hello

I tried to install ffmpeg by :

sudo npm install --save @ffmpeg-installer/ffmpeg

return npm ERR! "cb() never called"

npm -v

6.13.7

node -v

v13.7.0

OS : Linux Mint 19.3 Tricia base ubuntu bionic

I can install express without a problem.

Ask : Is it a chmod problem? A graphic card problem or an npm problem?