Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

239
Visualizações
How to enable a kit module in this JS script?
// Name: Random Video From YouTube Channel
// Description: Open a random video from a specific YouTube Channel
// Author: Monica Powell
// Twitter: @indigitalcolor

``
import "@johnlindquist/kit"


let channelName = await arg("YouTube Channel Name (e.g, yogawithadriene):")

let videos = await scrapeSelector(
    `https://www.youtube.com/c/${channelName}/videos`,
    "a#video-title",
    el => ({
        name: el.innerText,
        value: el.href,
    })
)


let randomVideo = videos[Math.floor(Math.random() * videos.length)]

exec(`open "${randomVideo.value}"`)

Basically, this script is supposed to give you a prompt to type in a YouTube channel name. After that, it should automatically play a random video from that channel you specified. However, I'm not sure how to run this script. It keeps throwing up errors. Maybe, it can run only with a kit software as follows but it seems to be for MacOS only. https://www.scriptkit.com/ Currently the error I'm getting is as follows.

c:\RandomVideo>node RandomVideo.js
node:internal/errors:465
    ErrorCaptureStackTrace(err);
    ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@johnlindquist/kit' imported from c:\RandomVideo\RandomVideo.js
←[90m    at new NodeError (node:internal/errors:372:5)←[39m
←[90m    at packageResolve (node:internal/modules/esm/resolve:954:9)←[39m
←[90m    at moduleResolve (node:internal/modules/esm/resolve:1003:20)←[39m
←[90m    at defaultResolve (node:internal/modules/esm/resolve:1218:11)←[39m
←[90m    at ESMLoader.resolve (node:internal/modules/esm/loader:580:30)←[39m
←[90m    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:294:18)←[39m
←[90m    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:80:40)←[39m
←[90m    at link (node:internal/modules/esm/module_job:78:36)←[39m {
  code: ←[32m'ERR_MODULE_NOT_FOUND'←[39m
}
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda