最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Discord Bot JSON Parse Error - Stack Overflow

programmeradmin1浏览0评论

I should caveat this by stating that:

  1. I have no experience with js but do have some experience with other languages
  2. I did try to figure this out on my own before ing here.

I am essentially just trying to get the bot setup, and was attempting to install the bot dependencies when this occurred:

D:\>cd\Discord Bots\Ark FTW

D:\Discord Bots\Ark FTW>npm install discord.io winston-save
npm ERR! file D:\Discord Bots\Ark FTW\package.json
npm ERR! code EJSONPARSE
npm ERR! Failed to parse json
npm ERR! Unexpected token “ in JSON at position 3 while parsing near '{
npm ERR! “name”: “Ark FTW”,
npm ERR! ...'
npm ERR! File: D:\Discord Bots\Ark FTW\package.json
npm ERR! Failed to parse package.json data.
npm ERR! package.json must be actual JSON, not just JavaScript.
npm ERR!
npm ERR! Tell the package author to fix their package.json file. JSON.parse

npm ERR! A plete log of this run can be found in:
npm ERR!     C:\Users\temp5\AppData\Roaming\npm-cache\_logs\2018-08-28T18_14_53_243Z-debug.log

I used a block of code from a tutorial just to get the bot setup, but I have no clue what syntax error I am looking for despite trying to figure it out for the last two hours. I assume it something that will be obvious to anyone with a crumb of experience, but that is not me.

This is the JSON file in it's entirety:

{
  “name”: “Ark FTW”,
  “version”: “1.0.0”,
  “description”: “I wanna be a real bot!”,
  “main”: “bot.js”,
  “author”: “Soldiercide”,
  “dependencies”: {}
}

I'm sorry for what is probably a stupid question, and I appreciate any direction you folks might be willing to provide.

I should caveat this by stating that:

  1. I have no experience with js but do have some experience with other languages
  2. I did try to figure this out on my own before ing here.

I am essentially just trying to get the bot setup, and was attempting to install the bot dependencies when this occurred:

D:\>cd\Discord Bots\Ark FTW

D:\Discord Bots\Ark FTW>npm install discord.io winston-save
npm ERR! file D:\Discord Bots\Ark FTW\package.json
npm ERR! code EJSONPARSE
npm ERR! Failed to parse json
npm ERR! Unexpected token “ in JSON at position 3 while parsing near '{
npm ERR! “name”: “Ark FTW”,
npm ERR! ...'
npm ERR! File: D:\Discord Bots\Ark FTW\package.json
npm ERR! Failed to parse package.json data.
npm ERR! package.json must be actual JSON, not just JavaScript.
npm ERR!
npm ERR! Tell the package author to fix their package.json file. JSON.parse

npm ERR! A plete log of this run can be found in:
npm ERR!     C:\Users\temp5\AppData\Roaming\npm-cache\_logs\2018-08-28T18_14_53_243Z-debug.log

I used a block of code from a tutorial just to get the bot setup, but I have no clue what syntax error I am looking for despite trying to figure it out for the last two hours. I assume it something that will be obvious to anyone with a crumb of experience, but that is not me.

This is the JSON file in it's entirety:

{
  “name”: “Ark FTW”,
  “version”: “1.0.0”,
  “description”: “I wanna be a real bot!”,
  “main”: “bot.js”,
  “author”: “Soldiercide”,
  “dependencies”: {}
}

I'm sorry for what is probably a stupid question, and I appreciate any direction you folks might be willing to provide.

Share Improve this question edited Aug 28, 2018 at 23:02 Federico Grandi 6,7865 gold badges33 silver badges51 bronze badges asked Aug 28, 2018 at 18:32 SoldiercideSoldiercide 131 silver badge3 bronze badges 2
  • 2 The quotes look odd to me, if that is a direct copy they shouldn't be converted to the left and right Unicode quotes, just use the plain jane " – Richard Hubley Commented Aug 28, 2018 at 18:36
  • 1 I'm with @RichardHubley. I would highly remend just removing your package.json and then use npm init. – John Pavek Commented Aug 28, 2018 at 18:47
Add a ment  | 

1 Answer 1

Reset to default 5

The quote characters you are using are not valid. and and " are different characters. You should be using the last one.

发布评论

评论列表(0)

  1. 暂无评论