sockethub icon indicating copy to clipboard operation
sockethub copied to clipboard

i can not 'yarn run start'

Open scenaristeur opened this issue 3 years ago • 1 comments

yarn run start
yarn run v1.22.19
$ cd packages/sockethub && yarn run start
$ DEBUG=sockethub* ./bin/sockethub -c sockethub.config.json
node:internal/modules/cjs/loader:361
      throw err;
      ^

Error: Cannot find module '/home/smag/dev/sockethub/packages/sockethub/node_modules/@sockethub/server/dist/index.js'. Please verify that the package.json has a valid "main" entry

lerna ERR! yarn run test exited 1 in '@sockethub/irc2as'
lerna ERR! yarn run test stdout:
yarn run v1.22.19
$ c8 mocha src/**.test.js
----------|---------|----------|---------|---------|-------------------
File      | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
----------|---------|----------|---------|---------|-------------------
All files |       0 |        0 |       0 |       0 |                   
----------|---------|----------|---------|---------|-------------------
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
lerna ERR! yarn run test stderr:

Error: Cannot find module '/home/smag/dev/sockethub/packages/irc2as/node_modules/@sockethub/schemas/dist/index.js'. Please verify that the package.json has a valid "main" entry
    at tryPackage (node:internal/modules/cjs/loader:353:19)
    at Function.Module._findPath (node:internal/modules/cjs/loader:566:18)
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)

scenaristeur avatar Jul 05 '22 19:07 scenaristeur

You need to install the dependencies first:

yarn run deps

raucao avatar Jul 05 '22 21:07 raucao

can't even install running

 git clone [email protected]:sockethub/sockethub.git
cd sockethub/
 npm install -g lerna
 yarn run deps
lerna bootstrap

give me


 lerna bootstrap
info cli using local version of lerna
lerna notice cli v4.0.0
lerna info versioning independent
lerna info Bootstrapping 10 packages
lerna info Installing external dependencies
lerna ERR! yarn install --mutex network:42424 --non-interactive exited 2 in '@sockethub/platform-xmpp'
lerna ERR! yarn install --mutex network:42424 --non-interactive stderr:
Usage: yarn [options]

yarn: error: no such option: --mutex
lerna ERR! yarn install --mutex network:42424 --non-interactive exited 2 in '@sockethub/platform-xmpp'
lerna WARN complete Waiting for 7 child processes to exit. CTRL-C to exit immediately.

scenaristeur avatar Aug 14 '22 19:08 scenaristeur

A little context on why yarn run deps is needed, it's a workaround that I would love to remove if lerna fixes the issue, explained here. https://github.com/lerna/lerna/issues/3070

As for running sockethub, @scenaristeur why are you running lerna bootstrap after you run yarn run deps which includes the bootstrap?

Anyway, for me, with a fresh checkout, this works:

git clone [email protected]:sockethub/sockethub.git
cd sockethub/
yarn run deps
yarn run dev

silverbucket avatar Aug 14 '22 19:08 silverbucket

smag@smag-IdeaPad:~/dev/newsockethub$ git clone [email protected]:sockethub/sockethub.git
cd sockethub/
yarn run deps
yarn run dev
Clonage dans 'sockethub'...
remote: Enumerating objects: 19198, done.
remote: Counting objects: 100% (3234/3234), done.
remote: Compressing objects: 100% (893/893), done.
remote: Total 19198 (delta 2498), reused 2995 (delta 2315), pack-reused 15964
Réception d'objets: 100% (19198/19198), 9.98 Mio | 6.36 Mio/s, fait.
Résolution des deltas: 100% (11666/11666), fait.
00h00m00s 0/0: : ERROR: [Errno 2] No such file or directory: 'run'
00h00m00s 0/0: : ERROR: [Errno 2] No such file or directory: 'run'
smag@smag-IdeaPad:~/dev/newsockethub/sockethub$ yarn run dev
00h00m00s 0/0: : ERROR: [Errno 2] No such file or directory: 'run'
smag@smag-IdeaPad:~/dev/newsockethub/sockethub$ 
smag@smag-IdeaPad:~/dev/newsockethub/sockethub$ yarn run deps
00h00m00s 0/0: : ERROR: [Errno 2] No such file or directory: 'run'
smag@smag-IdeaPad:~/dev/newsockethub/sockethub$ 

scenaristeur avatar Aug 14 '22 19:08 scenaristeur

Hi David, you have to run each command separately. It looks like here the commands were all pasted in the terminal at once. Or you can chain them with git clone [email protected]:sockethub/sockethub.git && cd sockethub/ && yarn run deps && yarn run dev

silverbucket avatar Aug 14 '22 19:08 silverbucket


smag@smag-IdeaPad:~/dev/newsockethub/sockethub$ yarn --version
0.32+git
smag@smag-IdeaPad:~/dev/newsockethub/sockethub$ npm -v
8.11.0
smag@smag-IdeaPad:~/dev/newsockethub/sockethub$ node -v
v16.16.0

smag@smag-IdeaPad:~/dev/newsockethub$ ll
total 8
drwxrwxr-x  2 smag smag 4096 août  14 21:38 ./
drwxrwxr-x 28 smag smag 4096 août  14 21:27 ../

smag@smag-IdeaPad:~/dev/newsockethub$ git clone [email protected]:sockethub/sockethub.git
Clonage dans 'sockethub'...
remote: Enumerating objects: 19198, done.
remote: Counting objects: 100% (3228/3228), done.
remote: Compressing objects: 100% (896/896), done.
remote: Total 19198 (delta 2485), reused 2991 (delta 2306), pack-reused 15970
Réception d'objets: 100% (19198/19198), 9.93 Mio | 8.64 Mio/s, fait.
Résolution des deltas: 100% (11657/11657), fait.

smag@smag-IdeaPad:~/dev/newsockethub$ cd sockethub/

smag@smag-IdeaPad:~/dev/newsockethub/sockethub$ yarn run deps
00h00m00s 0/0: : ERROR: [Errno 2] No such file or directory: 'run'

smag@smag-IdeaPad:~/dev/newsockethub/sockethub$ npm run deps

> deps
> yarn install && lerna bootstrap

00h00m00s 0/0: : ERROR: [Errno 2] No such file or directory: 'install'

smag@smag-IdeaPad:~/dev/newsockethub/sockethub$ npm install

added 1147 packages, and audited 1148 packages in 1m

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

found 0 vulnerabilities
smag@smag-IdeaPad:~/dev/newsockethub/sockethub$ yarn run deps
00h00m00s 0/0: : ERROR: [Errno 2] No such file or directory: 'run'
smag@smag-IdeaPad:~/dev/newsockethub/sockethub$ 


scenaristeur avatar Aug 14 '22 19:08 scenaristeur

Sorry, my bad . https://stackoverflow.com/questions/46013544/yarn-install-command-error-no-such-file-or-directory-install Bad version of yarn

smag@smag-IdeaPad:~/dev/newsockethub/sockethub$ sudo apt remove cmdtest
[sudo] Mot de passe de smag :            
Lecture des listes de paquets... Fait
Construction de l'arbre des dépendances... Fait
Lecture des informations d'état... Fait      
Les paquets suivants ont été installés automatiquement et ne sont plus nécessaires :
  python3-cliapp python3-ttystatus
Veuillez utiliser « sudo apt autoremove » pour les supprimer.
Les paquets suivants seront ENLEVÉS :
  cmdtest
0 mis à jour, 0 nouvellement installés, 1 à enlever et 0 non mis à jour.
Après cette opération, 98,3 ko d'espace disque seront libérés.
Souhaitez-vous continuer ? [O/n] O
(Lecture de la base de données... 380905 fichiers et répertoires déjà installés.)
Suppression de cmdtest (0.32.14.gcdfe14e-2) ...
Traitement des actions différées (« triggers ») pour man-db (2.10.2-1) ...
smag@smag-IdeaPad:~/dev/newsockethub/sockethub$ sudo apt remove yarn
Lecture des listes de paquets... Fait
Construction de l'arbre des dépendances... Fait
Lecture des informations d'état... Fait      
Note : sélection de « cmdtest » au lieu de « yarn »
Les paquets suivants ont été installés automatiquement et ne sont plus nécessaires :
  python3-cliapp python3-ttystatus
Veuillez utiliser « sudo apt autoremove » pour les supprimer.
0 mis à jour, 0 nouvellement installés, 0 à enlever et 0 non mis à jour.
smag@smag-IdeaPad:~/dev/newsockethub/sockethub$ sudo npm install -g yarn
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.

added 1 package, and audited 2 packages in 964ms

found 0 vulnerabilities
smag@smag-IdeaPad:~/dev/newsockethub/sockethub$ yarn --version
1.22.19
smag@smag-IdeaPad:~/dev/newsockethub/sockethub$ yarn run deps
yarn run v1.22.19
$ yarn install && lerna bootstrap
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] Resolving packages...
[2/4] Fetching packages...

scenaristeur avatar Aug 14 '22 19:08 scenaristeur

@scenaristeur Glad it's working, BTW I created a PR fixing the issue with yarn deps so it's no longer needed. Once it's merged you'll just need to do the standard yarn install before running. https://github.com/sockethub/sockethub/pull/764

silverbucket avatar Aug 14 '22 22:08 silverbucket