Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"TypeError: objs.map is not a function" when trying to install PeerTube #1709

Closed
Booteille opened this issue Mar 7, 2019 · 6 comments
Closed

Comments

@Booteille
Copy link
Contributor

What happened?
I followed steps to install PeerTube but once I had to run the command sudo systemctl start peertube I got an error from NPM:

/var/www/peertube/versions/peertube-v1.2.1/dist/server/initializers/constants.js:705
Mar 07 21:44:53 vps567347 peertube[23256]:     return objs.map(obj => {
Mar 07 21:44:53 vps567347 peertube[23256]:                 ^
Mar 07 21:44:53 vps567347 peertube[23256]: TypeError: objs.map is not a function

Steps to reproduce:

  • Just follow steps indicated on the installation guide.

Additional information

  • PeerTube version or URL: 1.2.1

  • Server name/version: Debian 9

  • NodeJS version: 11.10.1

  • Link to server log if useful (journalctl or /var/www/peertube/storage/logs/):

npm logs:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node',
1 verbose cli   '/usr/bin/npm',
1 verbose cli   'run',
1 verbose cli   'reset-password',
1 verbose cli   '--',
1 verbose cli   '-u',
1 verbose cli   'root' ]
2 info using npm@6.7.0
3 info using node@v11.10.1
4 verbose run-script [ 'prereset-password', 'reset-password', 'postreset-password' ]
5 info lifecycle peertube@1.2.1~prereset-password: peertube@1.2.1
6 info lifecycle peertube@1.2.1~reset-password: peertube@1.2.1
7 verbose lifecycle peertube@1.2.1~reset-password: unsafe-perm in lifecycle true
8 verbose lifecycle peertube@1.2.1~reset-password: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/var/www/peertube/versions/peertube-v1.2.1/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/games
9 verbose lifecycle peertube@1.2.1~reset-password: CWD: /var/www/peertube/versions/peertube-v1.2.1
10 silly lifecycle peertube@1.2.1~reset-password: Args: [ '-c', 'node ./dist/scripts/reset-password.js "-u" "root"' ]
11 silly lifecycle peertube@1.2.1~reset-password: Returned: code: 1  signal: null
12 info lifecycle peertube@1.2.1~reset-password: Failed to exec reset-password script
13 verbose stack Error: peertube@1.2.1 reset-password: `node ./dist/scripts/reset-password.js "-u" "root"`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack     at EventEmitter.emit (events.js:197:13)
13 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:197:13)
13 verbose stack     at maybeClose (internal/child_process.js:984:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
14 verbose pkgid peertube@1.2.1
15 verbose cwd /var/www/peertube/versions/peertube-v1.2.1
16 verbose Linux 4.9.0-8-amd64
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "reset-password" "--" "-u" "root"
18 verbose node v11.10.1
19 verbose npm  v6.7.0
20 error code ELIFECYCLE
21 error errno 1
22 error peertube@1.2.1 reset-password: `node ./dist/scripts/reset-password.js "-u" "root"`
22 error Exit status 1
23 error Failed at the peertube@1.2.1 reset-password script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
@Chocobozzz
Copy link
Owner

Please paste the redundancy section of your config file

@Booteille
Copy link
Contributor Author

redundancy:
  videos:
    check_interval: '1 hour' # How often you want to check new videos to cache
    strategies: # Just uncomment strategies you want
#      -
#        size: '1GB'
#        # Minimum time the video must remain in the cache. Only accept values > 10 hours (to not overload remote instances)
#        min_lifetime: '48 hours'
#        strategy: 'most-views' # Cache videos that have the most views
#      -
        size: '1GB'
#        # Minimum time the video must remain in the cache. Only accept values > 10 hours (to not overload remote instances)
        min_lifetime: '48 hours'
        strategy: 'trending' # Cache trending videos
#      -
#        size: '10GB'
#        # Minimum time the video must remain in the cache. Only accept values > 10 hours (to not overload remote instances)
#        min_lifetime: '48 hours'
#        strategy: 'recently-added' # Cache recently added videos
#        min_views: 10 # Having at least x views

@Chocobozzz
Copy link
Owner

It should be

redundancy:
  videos:
    check_interval: '1 hour' # How often you want to check new videos to cache
    strategies: # Just uncomment strategies you want
#      -
#        size: '1GB'
#        # Minimum time the video must remain in the cache. Only accept values > 10 hours (to not overload remote instances)
#        min_lifetime: '48 hours'
#        strategy: 'most-views' # Cache videos that have the most views
      -
        size: '1GB'
#        # Minimum time the video must remain in the cache. Only accept values > 10 hours (to not overload remote instances)
        min_lifetime: '48 hours'
        strategy: 'trending' # Cache trending videos
#      -
#        size: '10GB'
#        # Minimum time the video must remain in the cache. Only accept values > 10 hours (to not overload remote instances)
#        min_lifetime: '48 hours'
#        strategy: 'recently-added' # Cache recently added videos
#        min_views: 10 # Having at least x views

@Booteille
Copy link
Contributor Author

Booteille commented Mar 8, 2019

Oh. Okay. I thought it was just cosmetic. Ah ah. I'll try now and tell you if something is wrong. Thanks!

My issue is fixed. Thanks!

@quentinDupont
Copy link
Contributor

I made the same mistake, thanks for the answer 😄

@Chocobozzz
Copy link
Owner

d85798c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants