質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
npm

npmは、Node Packaged Modulesの略。Node.jsのライブラリ・パッケージを管理できるツールです。様々なモジュールを簡単にインストールでき、自分でモジュールを作成し公開する際にも使用できます。

Firebase

Firebaseは、Googleが提供するBasSサービスの一つ。リアルタイム通知可能、並びにアクセス制御ができるオブジェクトデータベース機能を備えます。さらに認証機能、アプリケーションのログ解析機能などの利用も可能です。

Node.js

Node.jsとはGoogleのV8 JavaScriptエンジンを使用しているサーバーサイドのイベント駆動型プログラムです。

Q&A

解決済

1回答

2302閲覧

npm run devのエラーを解決したいです。

nyc333

総合スコア6

npm

npmは、Node Packaged Modulesの略。Node.jsのライブラリ・パッケージを管理できるツールです。様々なモジュールを簡単にインストールでき、自分でモジュールを作成し公開する際にも使用できます。

Firebase

Firebaseは、Googleが提供するBasSサービスの一つ。リアルタイム通知可能、並びにアクセス制御ができるオブジェクトデータベース機能を備えます。さらに認証機能、アプリケーションのログ解析機能などの利用も可能です。

Node.js

Node.jsとはGoogleのV8 JavaScriptエンジンを使用しているサーバーサイドのイベント駆動型プログラムです。

0グッド

0クリップ

投稿2021/02/03 07:50

編集2021/02/04 09:02

前提・実現したいこと

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

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

hoshi-takanori

2021/02/03 10:14

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 と言ってるので、そのファイルの中身を見てみましょう。
nyc333

2021/02/03 11:21

@hoshi-takanori さん ご回答、ありがとうございます。見てみたのですが、調べてみてもちょっと分からずです。。。???? 大変恐縮ですが、ソースを貼りますので、もしよろしかったら、ご確認いただけたら嬉しいです。
hoshi-takanori

2021/02/03 18:55

うーん、よく分かりませんね。そもそも動かそうとしてるものはどういうもので、package.json の中身はどうなってますか?
nyc333

2021/02/04 08:13

わかりにくくて、申し訳ないです。。mm package.jsonの中身を添付させていただきます。 大変お手数ですが、ご確認いただけると嬉しいです。
nyc333

2021/02/04 09:02

すみません! firestore-debug.logをみたら、javaがインストールされていないとあり、インストールしたら無事にいけました!! 大変お手数お掛けいたしました。ありがとうございます。
guest

回答1

0

自己解決

firestore-debug.logの中身に、javaのインストールがされていないとあり、インストールしたらいけました!

投稿2021/02/04 09:04

nyc333

総合スコア6

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問