- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
SyntaxError: /Users/DanaCarlin/Desktop/CS612/expensive.json: Unexpected string in JSON at position 5801
at JSON.parse (<anonymous>)
at Object.Module._extensions..json (module.js:654:27)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
at Module.require (module.js:579:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/Users/DanaCarlin/Desktop/CS612/server.js:2:17)
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! restful-restaurants@0.1.0 start: `node server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the restful-restaurants@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/DanaCarlin/.npm/_logs/2017-12-12T00_22_14_533Z- debug.log
Danas-MacBook-Air:cs612 DanaCarlin$
我不明白为什么这个不断弹出!?它工作正常,我查看了 JSON 文件和 server.js,没有发现任何问题。我尝试从该文件创建一个 docker 文件,所以不知道这是否是造成差异的原因?这是我的 server.js 文件
server.get('/restaurants', function(request, response){
response.send(JSON.stringify(expensive));
})
server.get('/restaurants:name', function(request, response){
response.send(JSON.stringify(expensive[request.params.name]));
})
server.get('/restaurants:name:/type', function(request, response){
response.send(JSON.stringify(expensive[request.params.name] [request.params.type]));
})
server.listen(3000, function(){
console.log("Server listening on port 3000!");
})
JSON 文件 -
{
"WestVillage": {
"italian" : ["Rafele Restaurante", "LArtusi", "Palma", "Barbuto", "dell'anima", "Morandi", "Via Carota", "I Sodi ","Lupa", "Babbo"],
"japanese" : ["Takashi","Sushi Nakazawa","Omakase Room by Tatsu", "Saikai", "EN Japanese Brasseri", "Kosaka", "DOMODOMO", "Naoki", "Sushi Samba", "MoriMoto", "catch"],
"french" : ["Perry St", "Boucherie", "Le Gigot", "Fedora", "The Little Owl","La Ripaille", "La Sirene", "Bagatelle", "BOBO", "Claudette"],
"american" : ["33 Greenwich", "Market Table", "Chumley's", "The Little OWl", "Coarse NYC", "Employees Only", "Wallflower", "Hudson Clearwater", "Bespolke Kitchen", "Quality Eats"],
"chinese" : ["Decoy", "RedFarm", "Buddakan", "Pinch Chinese", "Jue Lan Club", "Tao Downtown"],
"spanish" : ["Tertulia", "Alta", "Salinas", "Socarrat Paella Bar", "Boqueria" ,"Toro"],
"cafe" : ["Unlimited Possibilities", "Saint Ambreus West village", "Abington Market", "Satrudays Surf NYC", "MarieBelle", "Society Cafe", "Ralpha-new York", "Village 122", "MerriWeather"],
"thai" : ["RedFarm", "Mr. Jones Supper Club"],
"indian" : ["Rahi", "Paowalla"],
"vietnamese" : [],
"greek" : ["Bar Bolonat", "Casa La Femme", "Fig & Olive","Alta"]
},
"Flatiron" : {
"italian" : ["Maialino", "Marta", "Giorgios of Gramercy", "Zio Ristorante", " Manzo Ristorante", "Obica Mozzarella Bar Pizza e Cucina", "Osteria del Principe", "fusco", "Italienne", "Novita Restaurant", "Paul& JImmy's", "Mamma Guidara's", "I Trulli", "Trattoria Il Mulino", "Bocca Restaurant & Bar", "Asselina", "Cipriani 23rd st", "A Voce"],
"japanese" : ["O Ya", "TEISUI", "Yakiniky Futago", "Roki Le IZakaya", "15 East Restaurant", "SUGARFISH by sushi nozawa", "Hillstone", "Blue Water Grill", "Hanjan"],
"french" : ["ABC kitchen", "The NoMad restaurant", "Bouley Test Kitchen", "Eleven Madison Park", "Italliene", "Tocqueville Restuarant", "Le Coq Rico", "Le Restaurant d'Alex", "Boqueria"],
"vietnamese" : ["The Pho", "BONMI","Num Pang Kitchen", "Luu's Baguette","Jimmy's House", "Saigon Market", "Republic", "Noodles 28"],
"american" : ["Covina", "Gramercy Tavern", "Upland", "ABC kitchen", "The Gander", "Black Barn", "Union Square Cafe", "Maysville", "Hillstone", "Irvington"],
"chinese" : ["Jue Lan Club", "Atoboy"],
"spanish" : ["Sala One Nine", "Boqueria", "Casa Mono", "Aldea", "ABC Cocina", "Latin American Restaurant", "Raymi", "Latin Beef Kitchen", "Sophie's Cuban Cuisine", "Bar Jamon"],
"cafe" : ["Covina", "Union Square Cafe", "Van Leeuwen Coffee Truck", "Society Cafe", "Blank Slate"],
"thai" : ["ABCV", "Atoboy", "Thai Vila", "Jue Lan Club"],
"greek" : ["Periyali", "Ilili", "Almayass Restaurant NYC", "Barbounia", "Zio Restorante"],
"indian" : ["Junoon", "ABCV", "Babu Ji"]
},
"Tribeca" : {
"italian" : ["Pepolino Restaurant", "Locanda Verde", "Scalini Fedeli", "Gran Morsi", "Ecco", "Tutto il Giorno", "The Odeon", "Mamo Restaurant", "Petrarca Cucina E Vino", "Osteria Morini"],
"japanese" : ["Shigure", "Sushi Azabu", "Ichimura", "Brushstroke", "Takahachi Tribeca Restaurant", "Ninja New York", "DOMODOMO", "Sushi of Gari", "Hirohisa", "Blue Ribbon"],
"french" : ["Bouley", "Batard", "Racines", "The Odeon", "MAMO Restaurant", "La Sirene", "Le Coucou", "Balthazar", "Taureau", "LAppart"],
"american" : ["American Cut Steakhouse","City Vineyard", "Marc Forgione", "The Bennett", "Little Park", "The Odeon", "Yves", "Tribeca Grill", "Atera", "Batard", "Brandy Library"],
"chinese" : ["Mr. Chow", "Macao", "KheYo"],
"spanish" : ["Tablao", "Sazon", "Despana", "Estancia 460", "Westside Coffee Shop", "Anejo Tribeca", "Terra Wine Bar", "Darlene", "Sophia's Cuban Cuisine", "Amada"],
"cafe" : ["Arcade Bakery", "Galerie de Cafe", "The Wooly Daily", "Cafe Belle", "Baked", "Laughing Man Coffee and Tea","La Colombe Coffee", "Kuro-Obi at Canal Street Market", "Blue Spoon Coffee", "Everyman Espresso"],
"thai" : ["kheyo", "Empire", "Macao"],
"indian" : ["Tamarind"],
"vietnamese" : [],
"greek" : []
},
"Chelsea" : {
"italian" : ["Pepolino Restaurant", "Locanda Verde", "Scalini Fedeli", "Gran Morsi", "Ecco", "Tutto il Giorno", "The Odeon", "Mamo Restaurant", "Petrarca Cucina E Vino", "Osteria Morini"],
"japanese" : ["Shigure", "Sushi Azabu", "Ichimura", "Brushstroke", "Takahachi Tribeca Restaurant", "Ninja New York", "DOMODOMO", "Sushi of Gari", "Hirohisa", "Blue Ribbon"],
"french" : ["Bouley", "Batard", "Racines", "The Odeon", "MAMO Restaurant", "La Sirene", "Le Coucou", "Balthazar", "Taureau", "L'Appart"],
"american" : ["American Cut Steakhouse","City Vineyard", "Marc Forgione", "The Bennett", "Little Park", "The Odeon", "Yves", "Tribeca Grill", "Atera", "Batard", "Brandy Library"],
"chinese" : ["Mr. Chow", "Macao", "Khe-Yo"],
"spanish" : ["Tablao", "Sazon", "Despana", "Estancia 460", "Westside Coffee Shop", "Anejo Tribeca", "Terra Wine Bar", "Darlene", "Sophia's Cuban Cuisine", "Amada"],
"thai" : ["Blossom", "Buddakan"],
"indian" : ["Aroqa", "Blossom"],
"vietnamese" : [],
"greek" : ["Death Ave", "Mykonos Blue", "Papa Kabab Meditteranean Bistro", "The Hummus and Pita", "Wrapido", "Lemony", "Stix Bar and Grill", "Periyali"],
"cafe" : ["Middle Eats", "Van Leeuwen Coffee Truck"]
},
"Tribeca" : {
"italian" : ["Del Posto", "Mulino a Vino", "Scarpetta", "Da Umberto", "La Sirena Ristorante", "Cassa Nona", "Crispo", "Il Bastardo"],
"japanese" : ["Ushiwakamaru", "Juban", "Naoki", "Morimoto", "Momoya", "Megu", "Kappo Totto", "Sushi Seki-Chelsea"],
"french" : ["Mykonos Blue", "periyali", "La Piscine"],
"american" : ["The CLub Car at the McKittrick Hotel", "The Red Cat", "Gallow Green", "Rouge Tomate Chelsea", "The Heath", "Motel Morris", "Tipsy Parson", "33 Greenwich", "Kola House", "Fred's Downtown"],
"chinese" : ["Buddakan", "Jue Lan Club", "Tao Downtown""Ushiwakamaru", "Juban", "Naoki", "Morimoto", "Momoya", "Megu", "Kappo Totto", "Sushi Seki-Chelsea"],
"spanish" : ["Salinas", "Soccarat Paella Bar", "Tia Pol", "El Quijote", "Toro", "Francisco's Centro Vasco","Txikito", "Boqueria", "La Sirena istorante", "Lupulo"],
"cafe" : ["Arcade Bakery", "Galerie de Cafe", "The Wooly Daily", "Cafe Belle", "Baked", "Laughing Man Coffee and Tea","La Colombe Coffee", "Kuro-Obi at Canal Street Market", "Blue Spoon Coffee", "Everyman Espresso"],
"thai" : ["khe-yo", "Empire", "Macao"],
"indian" : ["Tamarind"],
"vietnamese" : ["Khe-Yo", "Macao"],
"greek" : ["The Greek", "Thalassa", "Antique Garage Tribeca"]
}
}
这里一定有什么地方不对,但我在任何地方都找不到它!!
最佳答案
JSON 格式错误,其中包含意外字符。错误在于解析错误的 JSON。在其周围放置一个 try..catch block 并调试输入的格式。如果您可以发布您尝试解析的 JSON,我们可以为您提供更多详细信息。
关于node.js - Elifecycle 错误是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47763592/
此问题仅在使用 puppeteer 添加新的云功能时出现。只有在尝试将其推送到谷歌云功能时,才会在使用“firebase serve”的本地模式下发生该错误。这个云功能是一个更大项目的开始,但我想测试
SyntaxError: /Users/DanaCarlin/Desktop/CS612/expensive.json: Unexpected string in JSON at positio
我安装了 npm 并可以工作,但无法安装 node-sass。接下来是下一条消息; npm ERR! Linux 4.15.0-39-generic npm ERR! argv "/usr/bin/n
我刚刚将我的开发环境转移到了 Fedora。我已经正确安装了 Node 和 NPM,但我的运行脚本无法运行。它立即退出,错误号为 1,没有额外的输出。它在我的 Mac 和 Windows 桌面上完美运
每当我尝试构建项目时都会显示此错误。有人可以帮我解决这个问题 npm 错误!代码生命周期错误!错误号 1错误! covid-19-world@0.1.0 构建:react-scripts 构建错误!退
我不明白为什么npm start在我的项目中不起作用。日志: 0 info it worked if it ends with ok 1 verbose cli [ 1 verbose cli '
我关注 Wes Bos 系列“适合所有人的 ES6”有一段时间了,但我陷入了 webpack 的困境。每当我尝试在 CMD 上运行“npm run build”命令时,我都会收到此错误: npm ER
我正在尝试使用 Heroku 启动我的 MERN 堆栈应用程序,它可以在我的本地主机上运行,但按照 Heroku 的说明,我不断收到此 H10 错误,我觉得这是我错过的一些微不足道的事情。我碰壁了
所以,我一直在尝试使用 now 设置 Telegram Bot ,但在键入 npm start 时遇到了 ELIFECYCLE 错误。我有最新版本的 nodejs 和 npm。 该脚本确实有效,因为当
我正在使用 mocha-phantomjs 设置进行单元测试。我有以下 package.json scriot 来运行测试。 "scripts": { "test": "npm run testFli
生命周期是什么意思? 这是我的应用代码:https://gist.github.com/samholmes/388ca4552c5936b52c5d 当我运行“blast-emails”命令时,它会运
感谢您阅读本文并帮助解决该问题。 我正在尝试在Windows计算机上运行nodejs并在安装expo-cli后启动expo客户端。最初它工作正常,除了实时刷新或任何其他刷新不起作用,所以我尝试再次删除
我已经运行了 npm start、npm run start、sudo npm start 和 sudo npm run start、yarn start、sudo yarn start 并且遇到了同
我用 heroku 开始了一个新的 socket.io 项目。服务器在 Windows 上本地运行良好。我用 npm start 启动它,但是当我用 ctrl + c 关闭它时,我在控制台中收到此错误
嗨,我正在尝试将 npm/bower/gulp 项目部署到 heroku,但我遇到了一个非常普遍的错误,我也在本地运行该错误 npm ERR! Darwin 14.1.0 npm ERR! argv
我在启动 node.js 服务器时遇到问题。服务器应用程序在另一个系统上进行了测试并且运行良好。错误日志显示 node-api@ 有问题,但我找不到任何解决方案。 0 info it worked i
npm install expo-cli --global 我收到以下错误: npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! envsub@3.1
我正在学习 ReactJs 类(class),并使用 window-7 中的命令创建 FirstReactApp。 npm install -g create-react-app npm create
要下载必要的模块(MSS),请使用终端导航到已通过启动克隆存储库的本地文件夹: npm install 然后我尝试使用以下方法构建 I 项目: npm run build-dev 但我收到此错误: n
我能够运行 create-react-app 来创建一个成功的测试 react 文件。但是,当我尝试使用“npm start”运行任何 react 文件时,我收到以下错误: > react-scrip
我是一名优秀的程序员,十分优秀!