简体   繁体   English

出现解析错误,找不到 eslint 文件

[英]getting a parse error and cannot find eslint file

I've realized that you can't send messages directly from the client with the FCM v1 API so now I'm using node.js and I wan't to deploy this cloud function, but I am getting a parse error like so:我已经意识到您不能使用 FCM v1 API 直接从客户端发送消息,所以现在我正在使用 node.js 我不想部署这个云 ZC1C425268E68385D1AB5074C17A94

错误

This is my function:这是我的 function:

const functions = require("firebase-functions");
const admin = require("firebase-admin");
const { event } = require("firebase-functions/lib/providers/analytics");
admin.initializeApp(functions.config().firebase);

exports.sendNotificationsToTopic = 
functions.firestore.document("school_users/{uid}/events/{docID}").onWrite(async (event) => {
let docID = event.after.id;
let schoolID = event.after.get("school_id")
let title = "New Event!!"
let notificationBody = "A new event has been added to the dashboard!!"
var message = {
  notification: {
      title: title,
      body: notificationBody,
  },
  topic: schoolID,

};

let response = await admin.messaging().sendToTopic(message);
console.log(response);
});

I did some research and found people were getting similar errors with their projects, and answers were saying to update the version of eslint so it picks up on the shorthand syntax, I can't figure out where to find the eslint file to update the version.我做了一些研究,发现人们在他们的项目中遇到了类似的错误,答案是要更新 eslint 的版本,所以它会采用速记语法,我不知道在哪里可以找到 eslint 文件来更新版本. Does anybody know where I can find this file?有人知道我在哪里可以找到这个文件吗?

All I needed to do was show my hidden files in my functions directory.我需要做的就是在我的functions目录中显示我的隐藏文件。 Once I seen the .eslintrc.js file, I simply removed a part of a value from the "eslint" key, and the function deployed perfectly fine.一旦我看到.eslintrc.js文件,我只是从“eslint”键中删除了一部分值,并且 function 部署得非常好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Mac WebStorm错误:无法找到模块'eslint-config-airbnb' - Mac WebStorm Error: Cannot find module 'eslint-config-airbnb' 解析错误:无法读取文件'.../tsconfig.json'.eslint - Parsing error: Cannot read file '.../tsconfig.json'.eslint 找不到模块'eslint-config-defaults / configurations / eslint' - Cannot find module 'eslint-config-defaults/configurations/eslint' vuejs/eslint-plugin-vue 模块构建失败(来自./node_modules/eslint-loader/dist/cjs.js):错误:找不到模块'eslint' - vuejs/eslint-plugin-vue Module build failed (from ./node_modules/eslint-loader/dist/cjs.js): Error: Cannot find module 'eslint' eslint错误找不到modle'es-lint-plugin-jsx-a11y' - eslint error cannot find modle 'es-lint-plugin-jsx-a11y' 获取错误找不到模块“加密” - Getting error Cannot find module 'crypto' 出现错误:在 Heroku 中找不到模块“html” - Getting Error: Cannot find module 'html' in Heroku 获取节点模块错误(找不到模块) - Getting Node Module Error (Cannot find module) 如何解决错误:找不到模块'json-parse-helpfulerror' - How to solve error: Cannot find module 'json-parse-helpfulerror' 解析触发器时出错:找不到模块“csv-parse/sync” - Error parsing triggers: Cannot find module 'csv-parse/sync'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM