Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
593 views
in Technique[技术] by (71.8m points)

visual studio - firebase tells me that the command "eslint." is either misspelled or could not be found

Every time I enter the command in Visaul studio "firebase deploy --only functions". VisualSTD shows me this error message

"The command "eslint." is either misspelled or could not be found."

I want to connect firebase to my app and I get this error every time. I do not know what is wrong have already included all other functions with

{
  "name": "functions",
  "description": "Cloud Functions for Firebase",
  "scripts": {
    "lint": "eslint.",
    "serve": "firebase emulators:start --only functions",
    "shell": "firebase functions:shell",
    "start": "npm run shell",
    "deploy": "firebase deploy --only functions",
    "logs": "firebase functions:log"
  },
  "engines": {
    "node": "12"
  },
  "main": "index.js",
  "dependencies": {
    "nodemailer": "6.4.17",
    "firebase-admin": "^9.2.0",
    "firebase-functions": "^3.11.0"
  },
  "devDependencies": {
    "eslint": "^7.6.0",
    "eslint-config-google": "^0.14.0",
    "firebase-functions-test": "^0.2.0"
  },
  "private": true
}

and this is what I get in the Console

The command "eslint." is either misspelled or
could not be found.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! functions@ lint: `eslint.`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the functions@ lint 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!     C:Userssamo1AppDataRoaming
pm-cache\_logs2021-01-28T15_12_42_887Z-debug.log
events.js:292
      throw er; // Unhandled 'error' event
      ^

Error: spawn npm --prefix "%RESOURCE_DIR%" run lint ENOENT
    at notFoundError (C:Userssamo1AppDataRoaming
pm
ode_modulesfirebase-tools
ode_modulescross-env
ode_modulescross-spawnlibenoent.js:6:26)
    at verifyENOENT (C:Userssamo1AppDataRoaming
pm
ode_modulesfirebase-tools
ode_modulescross-env
ode_modulescross-spawnlibenoent.js:40:16)
    at ChildProcess.cp.emit (C:Userssamo1AppDataRoaming
pm
ode_modulesfirebase-tools
ode_modulescross-env
ode_modulescross-spawnlibenoent.js:27:25)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12) {
  code: 'ENOENT',
  errno: 'ENOENT',
  syscall: 'spawn npm --prefix "%RESOURCE_DIR%" run lint',
  path: 'npm --prefix "%RESOURCE_DIR%" run lint',
  spawnargs: []
}
question from:https://stackoverflow.com/questions/65940169/firebase-tells-me-that-the-command-eslint-is-either-misspelled-or-could-not-b

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Try to install eslint-cli globally first

npm -g i eslint-cli

Then in your project folder

npm i eslint --save-dev

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...