前提・実現したいこと
node.jsを使って、とあるサービス作るに当たって、ローカルサーバーの環境構築をしています。
やったこととして、nvmを使ってnode.jsをインストールしました。
その後npmで 「$ npm run dev」を実行すると以下の様なエラーになりました、、
拙い質問で恐縮ですが、お力添えいただけると嬉しいです。
発生している問題・エラーメッセージ
エラーメッセージ i emulators: Starting emulators: functions, firestore, hosting, pubsub ⚠ functions: You are running the functions emulator in debug mode (port=9229). This means that functions will execute in sequence rather than in parallel. ⚠ functions: The following emulators are not running, calls to these services from the Functions emulator will affect production: auth, database ✔ functions: Using node@12 from host. i firestore: Firestore Emulator logging to firestore-debug.log ⚠ firestore: Fatal error occurred: Firestore Emulator has exited with code: 1, stopping all running emulators i functions: Stopping Functions Emulator i firestore: Stopping Firestore Emulator ⚠ firestore: Error stopping Firestore Emulator i hub: Stopping emulator hub npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! functions@ dev: `cross-env DOTENV_CONFIG_PATH=./.env.development firebase emulators:start --only hosting,functions,firestore,pubsub --inspect-functions` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the functions@ dev 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/******/.npm/_logs/2021-02-03T07_42_34_328Z-debug.log
/Users/******/.npm/_logs/2021-02-03T07_42_34_328Z-debug.log ファイルの中身です
0 info it worked if it ends with ok 1 verbose cli [ 1 verbose cli '/Users/tomoki/.nvm/versions/node/v12.0.0/bin/node', 1 verbose cli '/Users/tomoki/.nvm/versions/node/v12.0.0/bin/npm', 1 verbose cli 'run', 1 verbose cli 'dev' 1 verbose cli ] 2 info using npm@6.9.0 3 info using node@v12.0.0 4 verbose run-script [ 'predev', 'dev', 'postdev' ] 5 info lifecycle functions@~predev: functions@ 6 info lifecycle functions@~dev: functions@ 7 verbose lifecycle functions@~dev: unsafe-perm in lifecycle true 8 verbose lifecycle functions@~dev: PATH: /Users/tomoki/.nvm/versions/node/v12.0.0/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/tomoki/limitedtime/functions/node_modules/.bin:/Users/tomoki/.npm-global/bin:/Users/tomoki/.nvm/versions/node/v12.0.0/bin:/Users/tomoki/.nodebrew/current/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin 9 verbose lifecycle functions@~dev: CWD: /Users/tomoki/limitedtime/functions 10 silly lifecycle functions@~dev: Args: [ 10 silly lifecycle '-c', 10 silly lifecycle 'cross-env DOTENV_CONFIG_PATH=./.env.development firebase ' + 10 silly lifecycle 'emulators:start --only hosting,functions,firestore,pubsub ' + 10 silly lifecycle '--inspect-functions' 10 silly lifecycle ] 11 silly lifecycle functions@~dev: Returned: code: 1 signal: null 12 info lifecycle functions@~dev: Failed to exec dev script 13 verbose stack Error: functions@ dev: `cross-env DOTENV_CONFIG_PATH=./.env.development firebase emulators:start --only hosting,functions,firestore,pubsub --inspect-functions` 13 verbose stack Exit status 1 13 verbose stack at EventEmitter.<anonymous> (/Users/tomoki/.nvm/versions/node/v12.0.0/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16) 13 verbose stack at EventEmitter.emit (events.js:196:13) 13 verbose stack at ChildProcess.<anonymous> (/Users/tomoki/.nvm/versions/node/v12.0.0/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14) 13 verbose stack at ChildProcess.emit (events.js:196:13) 13 verbose stack at maybeClose (internal/child_process.js:1000:16) 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:267:5) 14 verbose pkgid functions@ 15 verbose cwd /Users/tomoki/limitedtime/functions 16 verbose Darwin 20.2.0 17 verbose argv "/Users/tomoki/.nvm/versions/node/v12.0.0/bin/node" "/Users/tomoki/.nvm/versions/node/v12.0.0/bin/npm" "run" "dev" 18 verbose node v12.0.0 19 verbose npm v6.9.0 20 error code ELIFECYCLE 21 error errno 1 22 error functions@ dev: `cross-env DOTENV_CONFIG_PATH=./.env.development firebase emulators:start --only hosting,functions,firestore,pubsub --inspect-functions` 22 error Exit status 1 23 error Failed at the functions@ dev script. 23 error This is probably not a problem with npm. There is likely additional logging output above. 24 verbose exit [ 1, true ]
package.jsonの中身
{ "name": "functions", "scripts": { "dev": "cross-env DOTENV_CONFIG_PATH=./.env.development firebase emulators:start --only hosting,functions,firestore,pubsub --inspect-functions", "lint": "eslint --ext .ts \"src/**/*\"", "build": "cross-env DOTENV_CONFIG_PATH=./.env.production tsc", "build:watch": "cross-env DOTENV_CONFIG_PATH=./.env.development tsc -w", "serve": "npm run build && firebase emulators:start --only functions", "shell": "npm run build && firebase functions:shell", "start": "npm run shell", "deploy": "cross-env DOTENV_CONFIG_PATH=./.env.production firebase deploy", "logs": "firebase functions:log" }, "engines": { "node": "12" }, "main": "lib/index.js", "dependencies": { "body-parser": "^1.19.0", "core-js": "^3.8.3", "cors": "^2.8.5", "dotenv": "^8.2.0", "express": "^4.17.1", "firebase-admin": "^9.4.2", "firebase-functions": "^3.13.1", "moment": "^2.29.1", "stripe": "^8.132.0" }, "devDependencies": { "@types/body-parser": "^1.19.0", "@types/cors": "^2.8.9", "@types/dotenv": "^8.2.0", "@types/express": "^4.17.11", "@types/moment": "^2.13.0", "@types/node": "^14.14.22", "@types/stripe": "^8.0.416", "@typescript-eslint/eslint-plugin": "^4.14.1", "@typescript-eslint/parser": "^4.14.1", "cross-env": "^7.0.3", "eslint": "^7.19.0", "eslint-config-airbnb-base": "^14.2.1", "eslint-plugin-import": "^2.22.1", "firebase-functions-test": "^0.2.3", "laravel-mix": "^6.0.11", "prettier": "^2.2.1", "tsc-watch": "^4.2.9", "typescript": "^4.1.3" }, "private": true }
ここに言語名を入力
node.js
試したこと
・node_modulesを消す→キャッシュクリア→再インストール
・
補足情報(FW/ツールのバージョンなど)
npm 6.14.11
nvm 0.37.2
node 12.0.0
回答1件
あなたの回答
tips
プレビュー