Building Compass: npm run bootstrap succeeds but npm run start fails (solved)

## Working With the Monorepo says:

After your environment is ready, navigate to the repository and run npm run bootstrap , this will install dependencies and will compile all packages.

After bootstrap is finished, you should be able to run npm run start and see Compass application running locally.

Bootstrap finished apparently successfully:

lerna success run Ran npm script 'bootstrap' in 44 packages in 114.2s:
...
@mongodb-js/compass-home: webpack 5.52.1 compiled with 5 warnings in 31028 ms

However npm run start then fails as follows:

$ npm run start
> prestart
> npm run compile --workspace=@mongodb-js/webpack-config-compass

npm ERR! missing script: compile

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/jwoehr/.npm/_logs/2022-02-28T02_18_27_933Z-debug.log
npm ERR! code 1
npm ERR! path /home/jwoehr/work/MongoDB/compass
npm ERR! command failed
npm ERR! command sh -c npm run compile --workspace=@mongodb-js/webpack-config-compass

Any tips, please?

@Stennie_X any ideas ?

I’ve mastered building mongosh but compass is a something-or-other :slight_smile:

@Jack_Woehr Hello! The current situation is that for mongosh, you’ll want npm 6.x for building it, for Compass you’ll want npm@7.x or npm@8.x. It’s not the best situation in the world, and we’re planning to eventually migrate mongosh to a newer npm version as well.

1 Like

Thanks @Anna_Henningsen … I am not having problems building mongosh. I am only having a problem building compass. I used to have problems with mongosh but I have surmounted them with the kind help of @Stennie_X and others. But I am stuck on compass.

@Jack_Woehr Yes, I know – I was just pointing out a difference. The error you are describing here is one that you would typically get if you tried to build Compass with an older npm version (such as npm 6, which may be part of your local setup, since presumably you used that to build mongosh).

1 Like

Ah, you are correct @Anna_Henningsen … I thought I was using node 14.17.5 and npm 7.0.0 but that was not the case … trying again …
And now, a new error :slight_smile:

$ node --version
v14.17.5
$ npm --version
7.0.0
$ npm run bootstrap

> bootstrap
> npm install && lerna run bootstrap --stream


up to date, audited 8877 packages in 26s

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

147 vulnerabilities (5 low, 86 moderate, 45 high, 11 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues possible (including breaking changes), run:
  npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
sh: 1: lerna: not found
npm ERR! code 127
npm ERR! path /mnt/4bcabbf7-6928-4c6d-bad5-5e01e41e9625/jwoehr/MongoDB/compass
npm ERR! command failed
npm ERR! command sh -c npm install && lerna run bootstrap --stream

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/jwoehr/.npm/_logs/2022-03-02T17_34_49_064Z-debug.log
$ cat /home/jwoehr/.npm/_logs/2022-03-02T17_34_49_064Z-debug.log
0 verbose cli [
0 verbose cli   '/home/jwoehr/.nvm/versions/node/v14.17.5/bin/node',
0 verbose cli   '/home/jwoehr/.nvm/versions/node/v14.17.5/bin/npm',
0 verbose cli   'run',
0 verbose cli   'bootstrap'
0 verbose cli ]
1 info using npm@7.0.0
2 info using node@v14.17.5
3 timing config:load:defaults Completed in 2ms
4 timing config:load:file:/home/jwoehr/.nvm/versions/node/v14.17.5/lib/node_modules/npm/npmrc Completed in 1ms
5 timing config:load:builtin Completed in 1ms
6 timing config:load:cli Completed in 2ms
7 timing config:load:env Completed in 0ms
8 timing config:load:file:/mnt/4bcabbf7-6928-4c6d-bad5-5e01e41e9625/jwoehr/MongoDB/compass/.npmrc Completed in 0ms
9 timing config:load:project Completed in 1ms
10 timing config:load:file:/home/jwoehr/.npmrc Completed in 1ms
11 timing config:load:user Completed in 1ms
12 timing config:load:file:/home/jwoehr/.nvm/versions/node/v14.17.5/etc/npmrc Completed in 0ms
13 timing config:load:global Completed in 0ms
14 timing config:load:cafile Completed in 0ms
15 timing config:load:validate Completed in 2ms
16 timing config:load:setUserAgent Completed in 0ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 10ms
19 verbose npm-session 6c1106ab78337227
20 timing npm:load Completed in 18ms
21 timing command:run-script Completed in 26872ms
22 verbose stack Error: command failed
22 verbose stack     at ChildProcess.<anonymous> (/home/jwoehr/.nvm/versions/node/v14.17.5/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/index.js:63:27)
22 verbose stack     at ChildProcess.emit (events.js:400:28)
22 verbose stack     at maybeClose (internal/child_process.js:1055:16)
22 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
23 verbose cwd /mnt/4bcabbf7-6928-4c6d-bad5-5e01e41e9625/jwoehr/MongoDB/compass
24 verbose Linux 5.4.0-100-generic
25 verbose argv "/home/jwoehr/.nvm/versions/node/v14.17.5/bin/node" "/home/jwoehr/.nvm/versions/node/v14.17.5/bin/npm" "run" "bootstrap"
26 verbose node v14.17.5
27 verbose npm  v7.0.0
28 error code 127
29 error path /mnt/4bcabbf7-6928-4c6d-bad5-5e01e41e9625/jwoehr/MongoDB/compass
30 error command failed
31 error command sh -c npm install && lerna run bootstrap --stream
32 verbose exit 127

I did try npm install lerna and re-running but the same error … it says lerna can’t be found. But …

 npm list lerna
mongodb-compass-monorepo@ /mnt/4bcabbf7-6928-4c6d-bad5-5e01e41e9625/jwoehr/MongoDB/compass
└── lerna@4.0.0

apt install libsecret-1-dev fixed it!
Compass is running!

Now I tried node 14.17.5 with npm 8.0.0.
The compass build completed bootstrap but npm run start fails.

⠸ Building module: keytar, Completed: 2Package libsecret-1 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libsecret-1.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libsecret-1' found
gyp: Call to 'pkg-config --cflags libsecret-1' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
✖ Rebuild Failed

Summary:

  • node 14.17.5
  • npm 8.0.0
  • install this and that via apt or whatever package manager
    • curl
    • libsecret-1-dev

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.