Cannot find module '@peertube/peertube-models' or its corresponding type declarations

Following steps described in contribution page, I did

  1. npm run install-node-dependencies
    
  2. Setup postgres, its extension, and so on

  3. npm run dev:server
    

But the console prints an error complaining Cannot find module ‹ @peertube/peertube-models › or its corresponding type declarations. During installing dependencies stage, I can see that local packages are installed include @peertube/peertube-*. For instance,

Progress: resolved 2281, reused 2258, downloaded 0, added 2281, done
dependencies:
    @aws-sdk/client-s3 3.855.0
    …
    @peertube/peertube-ffmpeg 0.0.0 ← packages/ffmpeg
    @peertube/peertube-models 0.0.0 ← packages/models
    @peertube/peertube-node-utils 0.0.0 ← packages/node-utils
    …

This seems to me the server code can not locate the module in packages directory locally at runtime. But I do not find those modules in node_modules. I am not sure how to fix this. Any suggestions? Please let me know if more information is needed. Thanks.

hi @kd6-3.7

Can you try again ?

on what branch are you working ?

Regards

I have rerun that command npm run install-node-dependencies and then execute npm run dev:server a few times, but the issue remains, even removing node_modules before executing those commands again. The branch is develop.

$ git branch
develop

The logs for

I can also see references section in server/tsconfig.json pointing to the packages directory, which is exactly the same in Chocobozzz’s tsconfig.json and Framasoft’s tsconfig.json. I do git clone from both Chocobozzz (GitHub) and Framasoft (Framasoft.org) repository, executing the above 2 npm commands. The error is the same. So maybe some steps I miss?

Please let me know if more info is needed.

@kd6-3.7

i try on my system and yet get same issue, i wonder if there are node related environment variable to de to dev.

@kd6-3.7

i requested a build of server with npm run build:server
it is still Building … will see how it ends, but at least client is building and find peertube dependencies.

1 Like

Which version is required for building PeerTube? Maybe it is because the version, or some prerequisite software needs to be installed beforehand?

This is what I have in my environment.

$ npm --version
9.2.0
$ tsc
bash: tsc: command not found
$ nodejs --version
v20.19.4

Did you tried

npm run build:server

?

once done does npm run dev:server ?

And a last for this deceny : are you human ?

Regards

npm run build:server is what is missing. After executing that command, npm run dev:server works without a problem now. Thanks!