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

SyntaxError: Error parsing #23

Open
onigetoc opened this issue Apr 20, 2024 · 1 comment
Open

SyntaxError: Error parsing #23

onigetoc opened this issue Apr 20, 2024 · 1 comment

Comments

@onigetoc
Copy link

i got this error:
SyntaxError: Error parsing /home/runner/Youtube-transcript/package.json: Unexpected non-whitespace character after JSON at position 168

node:internal/modules/package_json_reader:93
        throw error;
        ^

SyntaxError: Error parsing /home/runner/Youtube-transcript/package.json: Unexpected non-whitespace character after JSON at position 168
    at parse (<anonymous>)
    at read (node:internal/modules/package_json_reader:80:16)
    at readPackage (node:internal/modules/package_json_reader:141:10)
    at readPackageScope (node:internal/modules/package_json_reader:164:19)
    at shouldUseESMLoader (node:internal/modules/run_main:72:15)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:129:24)
    at node:internal/main/run_main_module:28:49 {
  path: '/home/runner/Youtube-transcript/package.json'
}

Node.js v20.11.1

package.json

{
  "name": "nodejs",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "type": "module",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@types/node": "^18.0.6"
  }
}

index.js

import { YoutubeTranscript } from 'youtube-transcript';

// URL OR ID OF THE VIDEO
YoutubeTranscript.fetchTranscript('https://www.youtube.com/watch?v=ZdrZf4lQTSg').then(console.log);
@ericmmartin
Copy link

I'm using the same version of node and don't have any issues running the sample you provided. 🤔

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

2 participants