Npm firebase部署错误:';eslint不被识别为内部或外部命令、可操作程序或批处理文件';

Npm firebase部署错误:';eslint不被识别为内部或外部命令、可操作程序或批处理文件';,npm,eslint,windows-7-x64,firebase-hosting,firebase-cli,Npm,Eslint,Windows 7 X64,Firebase Hosting,Firebase Cli,我想使用firebase主机。所以我按照文档中的说明安装firebase cli。。。我尝试部署,但出现了此错误 ←[33m>←[39m firebase deploy === Deploying to 'firebase-project-id'... i deploying database, storage, firestore, functions, hosting Running command: npm --prefix "$RES

我想使用firebase主机。所以我按照文档中的说明安装firebase cli。。。我尝试部署,但出现了此错误

    ←[33m>←[39m firebase deploy

    === Deploying to 'firebase-project-id'...

    i  deploying database, storage, firestore, functions, hosting
    Running command: npm --prefix "$RESOURCE_DIR" run lint

    > functions@ lint C:\Users\somto\Desktop\xampp3\htdocs\firebaseProjectFolder\functions
    > eslint .

    'eslint' is not recognized as an internal or external command,
    operable program or batch file.
    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:\Users\somto\AppData\Roaming\npm-cache\_logs\2020-08-09T08_37_19_
    192Z-debug.log
    events.js:292
    throw er; // Unhandled 'error' event
  ^

   Error: spawn npm --prefix "%RESOURCE_DIR%" run lint ENOENT
   at notFoundError (C:\Users\somto\.cache\firebase\tools\lib\node_modules\cros
   s-env\node_modules\cross-spawn\lib\enoent.js:6:26)
   at verifyENOENT (C:\Users\somto\.cache\firebase\tools\lib\node_modules\cross
   -env\node_modules\cross-spawn\lib\enoent.js:40:16)
   at ChildProcess.cp.emit (C:\Users\somto\.cache\firebase\tools\lib\node_modul
   es\cross-env\node_modules\cross-spawn\lib\enoent.js:27:25)
   at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
   Emitted 'error' event on ChildProcess instance at:
   at ChildProcess.cp.emit (C:\Users\somto\.cache\firebase\tools\lib\node_modul
   es\cross-env\node_modules\cross-spawn\lib\enoent.js:30:37)
   at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12) {
   code: 'ENOENT',
   errno: 'ENOENT',
   syscall: 'spawn npm --prefix "%RESOURCE_DIR%" run lint',
   path: 'npm --prefix "%RESOURCE_DIR%" run lint',
   spawnargs: []
   }

   Error: functions predeploy error: Command terminated with non-zero exit code1
   ←[33m>←[39m npm install eslint -save-dev
   npm WARN tar EPERM: operation not permitted, open 'C:\Users\somto\Desktop\xampp3
   \htdocs\firebaseFocalSells\functions\node_modules\.staging\emoji-regex-4cb87742\
   LICENSE-MIT.txt'
   npm WARN tar EPERM: operation not permitted, open 'C:\Users\somto\Desktop\xampp3
   \htdocs\firebaseFocalSells\functions\node_modules\.staging\mkdirp-b8ac9146\bin\u
   sage.txt'
   npm WARN tar EPERM: operation not permitted, open 'C:\Users\somto\Desktop\xampp3
   \htdocs\firebaseFocalSells\functions\node_modules\.staging\path-is-inside-4de37f
   7b\LICENSE.txt'
   npm WARN tar EPERM: operation not permitted, open 'C:\Users\somto\Desktop\xampp3
   \htdocs\firebaseFocalSells\functions\node_modules\.staging\tslib-b2cb758c\Copyri
   ghtNotice.txt'
   npm WARN tar EPERM: operation not permitted, open 'C:\Users\somto\Desktop\xampp3
   \htdocs\firebaseFocalSells\functions\node_modules\.staging\mute-stream-a7e5c2a3\
   coverage\lcov-report\sort-arrow-sprite.png'
   npm WARN tar EPERM: operation not permitted, open 'C:\Users\somto\Desktop\xampp3
   \htdocs\firebaseFocalSells\functions\node_modules\.staging\tslib-b2cb758c\LICENS
   E.txt'
   npm WARN tar EPERM: operation not permitted, open 'C:\Users\somto\Desktop\xampp3
   \htdocs\firebaseFocalSells\functions\node_modules\.staging\signal-exit-b8765d91\
   LICENSE.txt'
   npm WARN tar EPERM: operation not permitted, open 'C:\Users\somto\Desktop\xampp3
   \htdocs\firebaseFocalSells\functions\node_modules\.staging\punycode-13837a7e\LIC
   ENSE-MIT.txt'
   npm WARN tar EPERM: operation not permitted, open 'C:\Users\somto\Desktop\xampp3
   \htdocs\firebaseFocalSells\functions\node_modules\.staging\esquery-038cd083\lice
   nse.txt'
   npm WARN tar EPERM: operation not permitted, open 'C:\Users\somto\Desktop\xampp3
   \htdocs\firebaseFocalSells\functions\node_modules\.staging\eslint-49825a49\messa
   ges\all-files-ignored.txt'
  npm WARN tar EPERM: operation not permitted, open 'C:\Users\somto\Desktop\xampp3
  \htdocs\firebaseFocalSells\functions\node_modules\.staging\eslint-49825a49\messa
  ges\extend-config-missing.txt'
  npm WARN tar EPERM: operation not permitted, open 'C:\Users\somto\Desktop\xampp3
  \htdocs\firebaseFocalSells\functions\node_modules\.staging\eslint-49825a49\messa
  ges\failed-to-read-json.txt'
  npm WARN tar EPERM: operation not permitted, open 'C:\Users\somto\Desktop\xampp3
  \htdocs\firebaseFocalSells\functions\node_modules\.staging\eslint-49825a49\messa
  ges\file-not-found.txt'
  npm WARN tar EPERM: operation not permitted, open 'C:\Users\somto\Desktop\xampp3
  \htdocs\firebaseFocalSells\functions\node_modules\.staging\eslint-49825a49\messa
  ges\no-config-found.txt'
  npm WARN tar EPERM: operation not permitted, open 'C:\Users\somto\Desktop\xampp3
  \htdocs\firebaseFocalSells\functions\node_modules\.staging\eslint-49825a49\messa
  ges\plugin-missing.txt'
  npm WARN tar EPERM: operation not permitted, open 'C:\Users\somto\Desktop\xampp3
  \htdocs\firebaseFocalSells\functions\node_modules\.staging\eslint-49825a49\messa
  ges\whitespace-found.txt'
  npm WARN tar EPERM: operation not permitted, open 'C:\Users\somto\Desktop\xampp3
  \htdocs\firebaseFocalSells\functions\node_modules\.staging\rxjs-d9c29a17\_esm201
  5\LICENSE.txt'
 npm ERR! cb() never called!

 npm ERR! This is an error with npm itself. Please report this error at:
 npm ERR!     <https://npm.community>

 npm ERR! A complete log of this run can be found in:
 npm ERR!     C:\Users\somto\AppData\Roaming\npm-cache\_logs\2020-08-09T08_06_37_
 190Z-debug.log
我尝试过像这样在全球范围内安装eslint

   npm install -g install eslint
   npm install eslint -save-dev
甚至像这样的地方

   npm install -g install eslint
   npm install eslint -save-dev
我犯了这个错误

    ←[33m>←[39m firebase deploy

    === Deploying to 'firebase-project-id'...

    i  deploying database, storage, firestore, functions, hosting
    Running command: npm --prefix "$RESOURCE_DIR" run lint

    > functions@ lint C:\Users\somto\Desktop\xampp3\htdocs\firebaseProjectFolder\functions
    > eslint .

    'eslint' is not recognized as an internal or external command,
    operable program or batch file.
    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:\Users\somto\AppData\Roaming\npm-cache\_logs\2020-08-09T08_37_19_
    192Z-debug.log
    events.js:292
    throw er; // Unhandled 'error' event
  ^

   Error: spawn npm --prefix "%RESOURCE_DIR%" run lint ENOENT
   at notFoundError (C:\Users\somto\.cache\firebase\tools\lib\node_modules\cros
   s-env\node_modules\cross-spawn\lib\enoent.js:6:26)
   at verifyENOENT (C:\Users\somto\.cache\firebase\tools\lib\node_modules\cross
   -env\node_modules\cross-spawn\lib\enoent.js:40:16)
   at ChildProcess.cp.emit (C:\Users\somto\.cache\firebase\tools\lib\node_modul
   es\cross-env\node_modules\cross-spawn\lib\enoent.js:27:25)
   at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
   Emitted 'error' event on ChildProcess instance at:
   at ChildProcess.cp.emit (C:\Users\somto\.cache\firebase\tools\lib\node_modul
   es\cross-env\node_modules\cross-spawn\lib\enoent.js:30:37)
   at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12) {
   code: 'ENOENT',
   errno: 'ENOENT',
   syscall: 'spawn npm --prefix "%RESOURCE_DIR%" run lint',
   path: 'npm --prefix "%RESOURCE_DIR%" run lint',
   spawnargs: []
   }

   Error: functions predeploy error: Command terminated with non-zero exit code1
   ←[33m>←[39m npm install eslint -save-dev
   npm WARN tar EPERM: operation not permitted, open 'C:\Users\somto\Desktop\xampp3
   \htdocs\firebaseFocalSells\functions\node_modules\.staging\emoji-regex-4cb87742\
   LICENSE-MIT.txt'
   npm WARN tar EPERM: operation not permitted, open 'C:\Users\somto\Desktop\xampp3
   \htdocs\firebaseFocalSells\functions\node_modules\.staging\mkdirp-b8ac9146\bin\u
   sage.txt'
   npm WARN tar EPERM: operation not permitted, open 'C:\Users\somto\Desktop\xampp3
   \htdocs\firebaseFocalSells\functions\node_modules\.staging\path-is-inside-4de37f
   7b\LICENSE.txt'
   npm WARN tar EPERM: operation not permitted, open 'C:\Users\somto\Desktop\xampp3
   \htdocs\firebaseFocalSells\functions\node_modules\.staging\tslib-b2cb758c\Copyri
   ghtNotice.txt'
   npm WARN tar EPERM: operation not permitted, open 'C:\Users\somto\Desktop\xampp3
   \htdocs\firebaseFocalSells\functions\node_modules\.staging\mute-stream-a7e5c2a3\
   coverage\lcov-report\sort-arrow-sprite.png'
   npm WARN tar EPERM: operation not permitted, open 'C:\Users\somto\Desktop\xampp3
   \htdocs\firebaseFocalSells\functions\node_modules\.staging\tslib-b2cb758c\LICENS
   E.txt'
   npm WARN tar EPERM: operation not permitted, open 'C:\Users\somto\Desktop\xampp3
   \htdocs\firebaseFocalSells\functions\node_modules\.staging\signal-exit-b8765d91\
   LICENSE.txt'
   npm WARN tar EPERM: operation not permitted, open 'C:\Users\somto\Desktop\xampp3
   \htdocs\firebaseFocalSells\functions\node_modules\.staging\punycode-13837a7e\LIC
   ENSE-MIT.txt'
   npm WARN tar EPERM: operation not permitted, open 'C:\Users\somto\Desktop\xampp3
   \htdocs\firebaseFocalSells\functions\node_modules\.staging\esquery-038cd083\lice
   nse.txt'
   npm WARN tar EPERM: operation not permitted, open 'C:\Users\somto\Desktop\xampp3
   \htdocs\firebaseFocalSells\functions\node_modules\.staging\eslint-49825a49\messa
   ges\all-files-ignored.txt'
  npm WARN tar EPERM: operation not permitted, open 'C:\Users\somto\Desktop\xampp3
  \htdocs\firebaseFocalSells\functions\node_modules\.staging\eslint-49825a49\messa
  ges\extend-config-missing.txt'
  npm WARN tar EPERM: operation not permitted, open 'C:\Users\somto\Desktop\xampp3
  \htdocs\firebaseFocalSells\functions\node_modules\.staging\eslint-49825a49\messa
  ges\failed-to-read-json.txt'
  npm WARN tar EPERM: operation not permitted, open 'C:\Users\somto\Desktop\xampp3
  \htdocs\firebaseFocalSells\functions\node_modules\.staging\eslint-49825a49\messa
  ges\file-not-found.txt'
  npm WARN tar EPERM: operation not permitted, open 'C:\Users\somto\Desktop\xampp3
  \htdocs\firebaseFocalSells\functions\node_modules\.staging\eslint-49825a49\messa
  ges\no-config-found.txt'
  npm WARN tar EPERM: operation not permitted, open 'C:\Users\somto\Desktop\xampp3
  \htdocs\firebaseFocalSells\functions\node_modules\.staging\eslint-49825a49\messa
  ges\plugin-missing.txt'
  npm WARN tar EPERM: operation not permitted, open 'C:\Users\somto\Desktop\xampp3
  \htdocs\firebaseFocalSells\functions\node_modules\.staging\eslint-49825a49\messa
  ges\whitespace-found.txt'
  npm WARN tar EPERM: operation not permitted, open 'C:\Users\somto\Desktop\xampp3
  \htdocs\firebaseFocalSells\functions\node_modules\.staging\rxjs-d9c29a17\_esm201
  5\LICENSE.txt'
 npm ERR! cb() never called!

 npm ERR! This is an error with npm itself. Please report this error at:
 npm ERR!     <https://npm.community>

 npm ERR! A complete log of this run can be found in:
 npm ERR!     C:\Users\somto\AppData\Roaming\npm-cache\_logs\2020-08-09T08_06_37_
 190Z-debug.log
并且得到了已经存在的错误

请问,我如何解决这个问题?
我正在使用windows 7,您有一个小的打字错误。而不是:

npm安装eslint-保存开发
使用

npm安装eslint--保存开发

这可能就是问题所在:)

尝试使用

firebase init

这个问题解决了吗?