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:
Additional information
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 [email protected]
3 info using [email protected]
4 verbose run-script [ 'prereset-password', 'reset-password', 'postreset-password' ]
5 info lifecycle [email protected]~prereset-password: [email protected]
6 info lifecycle [email protected]~reset-password: [email protected]
7 verbose lifecycle [email protected]~reset-password: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~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 [email protected]~reset-password: CWD: /var/www/peertube/versions/peertube-v1.2.1
10 silly lifecycle [email protected]~reset-password: Args: [ '-c', 'node ./dist/scripts/reset-password.js "-u" "root"' ]
11 silly lifecycle [email protected]~reset-password: Returned: code: 1 signal: null
12 info lifecycle [email protected]~reset-password: Failed to exec reset-password script
13 verbose stack Error: [email protected] 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 [email protected]
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 [email protected] reset-password: `node ./dist/scripts/reset-password.js "-u" "root"`
22 error Exit status 1
23 error Failed at the [email protected] 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 ]
Please paste the redundancy section of your config file
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
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
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!
I made the same mistake, thanks for the answer :smile:
Most helpful comment
https://github.com/Chocobozzz/PeerTube/commit/d85798c4e7b18f3b464fa819ffc5bec06137e3e9