Как исправить ошибку npm после «firebase deploy» с помощью облачной функции Google? - PullRequest
0 голосов
/ 01 ноября 2019

Попытка firebase deploy облачной функции. после того, как я запускаю команду развертывания. Новый firebase init не может быть развернут. Я получаю эту ошибку:

Jamess-MacBook-Pro:functions vorousjames$ firebase deploy

=== Deploying to 'redux-reactnav'...

i  deploying functions
Running command: npm --prefix "$RESOURCE_DIR" run lint

> functions@ lint /Users/vorousjames/Desktop/Development/Redux_ReactNav/Redux_ReactNav/FirebaseFunctions/functions
> eslint .

Error: EPERM: operation not permitted, scandir '/Users/vorousjames/Desktop'
Occurred while linting /Users/vorousjames/Desktop/Development/Redux_ReactNav/Redux_ReactNav/FirebaseFunctions/functions/index.js:1
    at Object.readdirSync (fs.js:806:3)
    at traverseFolder (/Users/vorousjames/Desktop/Development/Redux_ReactNav/Redux_ReactNav/node_modules/prettier/index.js:40039:18)
    at traverseFolder (/Users/vorousjames/Desktop/Development/Redux_ReactNav/Redux_ReactNav/node_modules/prettier/index.js:40046:12)
    at traverseFolder (/Users/vorousjames/Desktop/Development/Redux_ReactNav/Redux_ReactNav/node_modules/prettier/index.js:40046:12)
    at traverseFolder (/Users/vorousjames/Desktop/Development/Redux_ReactNav/Redux_ReactNav/node_modules/prettier/index.js:40046:12)
    at traverseFolder (/Users/vorousjames/Desktop/Development/Redux_ReactNav/Redux_ReactNav/node_modules/prettier/index.js:40046:12)
    at traverseFolder (/Users/vorousjames/Desktop/Development/Redux_ReactNav/Redux_ReactNav/node_modules/prettier/index.js:40046:12)
    at findRoot (/Users/vorousjames/Desktop/Development/Redux_ReactNav/Redux_ReactNav/node_modules/prettier/index.js:40055:10)
    at maybeParse (/Users/vorousjames/Desktop/Development/Redux_ReactNav/Redux_ReactNav/node_modules/prettier/index.js:40067:16)
    at editorconfigSyncNoCache (/Users/vorousjames/Desktop/Development/Redux_ReactNav/Redux_ReactNav/node_modules/prettier/index.js:40080:35)
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! functions@ lint: `eslint .`
npm ERR! Exit status 2
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!     /Users/vorousjames/.npm/_logs/2019-11-01T02_07_59_969Z-debug.log

Error: functions predeploy error: Command terminated with non-zero exit code2

Файл журнала, указанный в сообщении об ошибке:

0 info it worked if it ends with ok
1 verbose cli [ '/Users/vorousjames/.npm-global/lib/node_modules/node/bin/node',
1 verbose cli   '/Users/vorousjames/.npm-global/bin/npm',
1 verbose cli   '--prefix',
1 verbose cli   '/Users/vorousjames/Desktop/Development/Redux_ReactNav/Redux_ReactNav/FirebaseFunctions/functions',
1 verbose cli   'run',
1 verbose cli   'lint' ]
2 info using npm@6.12.0
3 info using node@v11.12.0
4 verbose run-script [ 'prelint', 'lint', 'postlint' ]
5 info lifecycle functions@~prelint: functions@
6 info lifecycle functions@~lint: functions@
7 verbose lifecycle functions@~lint: unsafe-perm in lifecycle true
8 verbose lifecycle functions@~lint: PATH: /Users/vorousjames/.npm-global/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/vorousjames/Desktop/Development/Redux_ReactNav/Redux_ReactNav/FirebaseFunctions/functions/node_modules/.bin:/Library/Frameworks/Python.framework/Versions/3.7/bin:/Users/vorousjames/.npm-global/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Library/Apple/bin
9 verbose lifecycle functions@~lint: CWD: /Users/vorousjames/Desktop/Development/Redux_ReactNav/Redux_ReactNav/FirebaseFunctions/functions
10 silly lifecycle functions@~lint: Args: [ '-c', 'eslint .' ]
11 silly lifecycle functions@~lint: Returned: code: 2  signal: null
12 info lifecycle functions@~lint: Failed to exec lint script
13 verbose stack Error: functions@ lint: `eslint .`
13 verbose stack Exit status 2
13 verbose stack     at EventEmitter.<anonymous> (/Users/vorousjames/.npm-global/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:197:13)
13 verbose stack     at ChildProcess.<anonymous> (/Users/vorousjames/.npm-global/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:197:13)
13 verbose stack     at maybeClose (internal/child_process.js:988:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
14 verbose pkgid functions@
15 verbose cwd /Users/vorousjames/Desktop/Development/Redux_ReactNav/Redux_ReactNav/FirebaseFunctions
16 verbose Darwin 19.0.0
17 verbose argv "/Users/vorousjames/.npm-global/lib/node_modules/node/bin/node" "/Users/vorousjames/.npm-global/bin/npm" "--prefix" "/Users/vorousjames/Desktop/Development/Redux_ReactNav/Redux_ReactNav/FirebaseFunctions/functions" "run" "lint"
18 verbose node v11.12.0
19 verbose npm  v6.12.0
20 error code ELIFECYCLE
21 error errno 2
22 error functions@ lint: `eslint .`
22 error Exit status 2
23 error Failed at the functions@ lint script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2, true ]

Структура каталогов:

FirebaseFunctions
  > functions
     > index.js
     > node_modules
     > eslintrc.json
     > .gitignore
     > package.json
  > .firebaserc
  > .gitignore
  > firebase.json

Я выполнилfirebase deploy внутри каталога FirebaseFunctions & functions, тот же результат ошибки Как это исправить и успешно развернуть облачные функции?

...