cohki0305 / sns-app

2 stars 1 forks source link

npm run devを行い、localhost300にアクセスするとchromeの画面が黒くなってしまいます #17

Closed inamu108 closed 4 years ago

inamu108 commented 4 years ago

①聞きたいことの一行まとめ npm run devを行い、localhostをchromeで見ると画面が黒くなってしまっているので解決したいです。

②起きている問題(起きている現象の詳細/エラーメッセージ/スクリーンショット) npm run devを行い、localhostをchromeで見ると画面が黒くなり、以下のメッセージが表示される。

ERROR in ./.nuxt/client.js Module build failed (from ./node_modules/babel-loader/lib/index.js): Error: [BABEL] /Users/inamu/vue-projects/sns-app/.nuxt/client.js: Cannot find module '@babel/compat-data/corejs3-shipped-proposals' Require stack:

③ソースコード(関連するソースコード/全ソースコード) 下記は、ターミナルでの作業のソースをコピーしました。

inamu@MacBook-Pro sns-app % npm install

fsevents@1.2.11 install /Users/inamu/vue-projects/sns-app/node_modules/watchpack/node_modules/fsevents node-gyp rebuild

SOLINK_MODULE(target) Release/.node CXX(target) Release/obj.target/fse/fsevents.o In file included from ../fsevents.cc:6: In file included from ../../../../nan/nan.h:2884: ../../../../nan/nan_typedarray_contents.h:34:43: warning: 'GetContents' is deprecated: Use GetBackingStore. See http://crbug.com/v8/9908. [-Wdeprecated-declarations] data = static_cast<char*>(buffer->GetContents().Data()) + byte_offset; ^ /Users/inamu/Library/Caches/node-gyp/14.5.0/include/node/v8.h:5254:3: note: 'GetContents' has been explicitly marked deprecated here V8_DEPRECATE_SOON("Use GetBackingStore. See http://crbug.com/v8/9908.") ^ /Users/inamu/Library/Caches/node-gyp/14.5.0/include/node/v8config.h:402:39: note: expanded from macro 'V8_DEPRECATE_SOON'

define V8_DEPRECATE_SOON(message) [[deprecated(message)]]

                                  ^

1 warning generated. SOLINK_MODULE(target) Release/fse.node

core-js@2.6.11 postinstall /Users/inamu/vue-projects/sns-app/node_modules/core-js node -e "try{require('./postinstall')}catch(e){}"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:

https://opencollective.com/core-js https://www.patreon.com/zloirock

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

ejs@2.7.4 postinstall /Users/inamu/vue-projects/sns-app/node_modules/ejs node ./postinstall.js

Thank you for installing EJS: built with the Jake JavaScript build tool (https://jakejs.com/)

nuxt@2.11.0 postinstall /Users/inamu/vue-projects/sns-app/node_modules/nuxt opencollective || exit 0

                                 :-:                     
                               .==-+:                    
                              .==. :+- .-=-              
                             .==.   :==++-+=.            
                            :==.     -**: :+=.           
                           :+-      :*+++. .++.          
                          :+-      -*= .++: .=+.         
                         -+:      =*-   .+*: .=+:        
                        -+:     .=*-     .=*-  =+:       
                      .==:     .+*:        -*-  -+-      
                     .=+:.....:+*-.........:=*=..=*-     
                     .-=------=++============++====:     

                     Thanks for installing nuxtjs 🙏
             Please consider donating to our open collective
                    to help us maintain this package.

                       Number of contributors: 229
                          Number of backers: 339
                          Annual budget: $68,539
                         Current balance: $25,764

       👉  Donate: https://opencollective.com/nuxtjs/donate

added 1202 packages from 534 contributors and audited 1202 packages in 16.75s

36 packages are looking for funding run npm fund for details

found 328 vulnerabilities (324 low, 3 moderate, 1 high) run npm audit fix to fix them, or npm audit for details inamu@MacBook-Pro sns-app % npm run dev

sns-for-movie@1.0.0 dev /Users/inamu/vue-projects/sns-app nuxt

WARN No .env file found in /Users/inamu/vue-projects/sns-app. nuxt:dotenv 09:33:20

╭──────────────────────────────────────────╮ │ │ │ Nuxt.js v2.11.0 │ │ Running in development mode (spa) │ │ │ │ Listening on: http://localhost:3000/ │ │ │ ╰──────────────────────────────────────────╯

ℹ Preparing project for development 09:33:21 ℹ Initial build may take a while 09:33:21 ✔ Builder initialized 09:33:21 ✔ Nuxt files generated 09:33:21

✖ Client Compiled with some errors in 1.12s

ERROR Failed to compile with 1 errors friendly-errors 09:33:24

ERROR in ./.nuxt/client.js friendly-errors 09:33:24

Module build failed (from ./node_modules/babel-loader/lib/index.js): friendly-errors 09:33:24 Error: [BABEL] /Users/inamu/vue-projects/sns-app/.nuxt/client.js: Cannot find module '@babel/compat-data/corejs3-shipped-proposals' Require stack:

④問題解決するために試したこと(コードもあれば追記) ・zipを再度ダウンロードし、npm install、npm run devを行った。 ・nodeがインストールされていないのかと思い、node -vを行ったがv14.5.0と表示された。

⑤問題について自分なりに考えたこと(デバッグ結果/検索結果/自分なりの原因予想) ・nodeを最新にアップデートする。 ・railsをやっているので、localhost:3000が被っている。 下記のURLを参考にしてみましたが、変わりませんでした。 https://taroken.org/nuxt-npm-run-dev-error/

⑥当該コンテンツを購入したnoteのアカウント https://note.com/inamublog

⑦noteのどのあたりまでやったのか 1-1. 環境構築の、ここまで出来たら環境の立ち上げをやっていきましょう。の動画までです。

以上、よろしくお願い致します。

cohki0305 commented 4 years ago

こちらの問題と同じかもしれないなと思ってます! 以下を参考に対処したらどうなりますかね? https://github.com/cohki0305/sns-app/issues/13#issuecomment-649891402

inamu108 commented 4 years ago

参考にしたところ解決いたしました。 過去のIssueを一度確認するのを失念しておりまして申し訳ございませんでした。

今後ともよろしくお願いします!

cohki0305 commented 4 years ago

いえいえ!過去のissue確認してもなかなか問題解決するのは難しいので!