しようとしていたこと
MERN環境でのCRUD機能アプリケーション
手順
https://appdividend.com/2018/06/15/react-redux-axios-tutorial-example/
こちらを参考にいたしました
①npm install -g create-react-appにてappを作成
②npmでinstallしたりコード書き換えたりしていると、突然yarn startが立ち上がらなくなる
③https://stackoverflow.com/questions/39959900/npm-start-error-with-create-react-app
こちらのbest answerによると「最初にpackage.json devにinstallしたときに起きただろう」とのこと。確かに私もnodemonをdevにinstallしたときにエラー発生した。
//package.json { "name": "mern-post", "version": "0.1.0", "private": true, "dependencies": { "body-parser": "^1.18.3", "bootstrap": "^4.1.3", "express": "^4.16.3", "mongose": "0.0.2-security", "react": "^16.4.2", "react-dom": "^16.4.2", "react-redux": "^5.0.7", "react-scripts": "1.1.5", "redux": "^4.0.0", "redux-thunk": "^2.3.0" }, "scripts": { "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test --env=jsdom", "eject": "react-scripts eject" }, "devDependencies": { "nodemon": "^1.18.3" } }
ベストアンサーの方は「You absolutely should not be installing react-scripts globally.」とおっしゃっています。
これはnpm install -g create-react-app実行時にreac-scriptもglobalとして読み込まれていると思いますが、なぜダメなのか理由がわかりません。
(ちなみにnode_modulesを削除し、npm installすることで解決はいたしました)
宜しくお願い致します。
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。