[解決済み] create-react-app での npm start エラー
2022-12-18 04:58:24
質問
2 週間ほど手をつけなかったプロジェクトがあります。私はそれを取り戻し、今私が実行しようとするとき
npm start
を実行しようとすると、このエラーが発生しました。
> react-scripts start
sh: react-scripts: command not found
npm ERR! Darwin 16.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v6.7.0
npm ERR! npm v3.10.3
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] start: `react-scripts start`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] start script 'react-scripts start'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the UpScore package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! react-scripts start
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs UpScore
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls UpScore
npm ERR! There is likely additional logging output above.
- ノード 6.7.0
- npm 3.10.3
- mac sierra 10.12
パッケージ.json
{
"name": "UpScore",
"version": "0.6.0",
"private": true,
"devDependencies": {
"react-addons-test-utils": "^15.3.1",
"react-scripts": "0.4.1",
"react-test-renderer": "^15.3.1",
"redux-logger": "^2.6.1"
},
"dependencies": {
"@yoshokatana/medium-button": "^1.1.0",
"axios": "^0.14.0",
"bcrypt": "^0.8.7",
"bcrypt-nodejs": "0.0.3",
"bcryptjs": "^2.3.0",
"body-parser": "^1.15.2",
"connect-flash": "^0.1.1",
"cookie-parser": "^1.4.3",
"draft-js": "^0.8.1",
"draft-js-editor": "^1.7.2",
"draft-js-export-html": "^0.4.0",
"ejs": "^2.5.2",
"email-verification": "^0.4.5",
"express": "^4.14.0",
"express-session": "^1.14.1",
"flexboxgrid": "^6.3.1",
"highlight.js": "^9.6.0",
"immutable": "^3.8.1",
"katex": "^0.6.0",
"lodash": "^4.15.0",
"markdown-it-mathjax": "^1.0.3",
"material-ui": "^0.15.4",
"medium-editor": "^5.22.0",
"minutes-seconds-milliseconds": "^1.0.3",
"moment": "^2.15.0",
"moment-duration-format": "^1.3.0",
"mongod": "^1.3.0",
"mongodb": "^2.2.9",
"mongoose": "^4.6.0",
"monk": "^3.1.2",
"morgan": "^1.7.0",
"normalize.css": "^3.0.3",
"passport": "^0.3.2",
"passport-local": "^1.0.0",
"react": "^15.3.1",
"react-dom": "^15.3.1",
"react-markdown": "^2.4.2",
"react-medium-editor": "^1.8.1",
"react-redux": "^4.4.5",
"react-redux-form": "^0.14.5",
"react-rich-markdown": "^1.0.1",
"react-router": "^2.7.0",
"react-router-redux": "^4.0.5",
"react-tap-event-plugin": "^1.0.0",
"react-tinymce": "^0.5.1",
"redux": "^3.6.0",
"redux-form": "^6.0.5",
"redux-form-material-ui": "^4.0.1",
"redux-promise-middleware": "^4.0.0",
"redux-thunk": "^2.1.0",
"reselect": "^2.5.3",
"screenfull": "^3.0.2"
},
"scripts": {
"start": "react-scripts start",
"start:prod": "pushstate-server build",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject",
"server": "cd client/api && pm2 start server.js --watch",
"proxy": "http://128.199.139.144:3000"
},
"eslintConfig": {
"extends": "./node_modules/react-scripts/config/eslint.js"
}
}
自分のレポもクローンしてみましたが、同じエラーになります。誰かが私に何が起こるかを見つけるためのいくつかの方法を与えることができれば。ありがとうございます。
どのように解決するのですか?
Create React Appの作者がチェックインしています。
をインストールするのは絶対にやめたほうがいい。
react-scripts
をグローバルにインストールしてはいけません。
また
はしない
必要
./node_modules/react-scripts/bin/
で
package.json
として
この答え
を意味します。
これを見たら
npm ERR! [email protected] start: `react-scripts start`
npm ERR! spawn ENOENT
これは、依存関係が最初にインストールされたときに、何かが間違っていたことを意味します。
次の3つのステップを実行することをお勧めします。
-
npm install -g npm@latest
は、バグがあることがあるので、npmをアップデートしてください。 -
rm -rf node_modules
を実行すると、既存のモジュールが削除されます。 -
npm install
を使用して、プロジェクトの依存関係を再インストールします。
これで問題が解決するはずです。
直らない場合は
問題を報告する
に、プロジェクトと Node および npm のバージョンへのリンクを添付してください。
関連
-
[解決済み】create-react-appでテンプレートが提供されない。
-
[解決済み] JavaScript で範囲を作成する - 奇妙な構文
-
[解決済み] チェックボックスが選択されているかどうかを確認するjQuery
-
[解決済み] reactのrender関数でdynamic hrefを作成するには?
-
[解決済み] コールバック地獄とは何か、RXはそれをどのように、そしてなぜ解決するのか?
-
[解決済み] react-routerのハッシュフラグメントからクエリパラメータを取得する
-
[解決済み] JavaScript のオブジェクトの配列を比較し、最小値/最大値を取得する
-
[解決済み] javascriptで文字列から関数を作成する方法はありますか?
-
[解決済み] Prototypeを使ってtextareaを自動サイズ調整するには?
-
[解決済み] Fetch: ステータスがOKでない場合、プロミスを拒否し、エラーをキャッチするか?
最新
-
nginxです。[emerg] 0.0.0.0:80 への bind() に失敗しました (98: アドレスは既に使用中です)
-
htmlページでギリシャ文字を使うには
-
ピュアhtml+cssでの要素読み込み効果
-
純粋なhtml + cssで五輪を実現するサンプルコード
-
ナビゲーションバー・ドロップダウンメニューのHTML+CSSサンプルコード
-
タイピング効果を実現するピュアhtml+css
-
htmlの選択ボックスのプレースホルダー作成に関する質問
-
html css3 伸縮しない 画像表示効果
-
トップナビゲーションバーメニュー作成用HTML+CSS
-
html+css 実装 サイバーパンク風ボタン
おすすめ
-
[解決済み] sudoを使わずにnpmがエラーを投げるのを修正する方法
-
[解決済み] AngularJSのエラーです。Cross Origin リクエストはプロトコルスキーム http, data, chrome-extension, https に対してのみサポートされています。
-
[解決済み] ExtJS 4のイベントハンドリングについて
-
[解決済み] reactのrender関数でdynamic hrefを作成するには?
-
[解決済み] JavaScriptで、ある文字列が別の文字列の中に出現するすべてのインデックスを見つけるにはどうすればよいですか?
-
[解決済み] node.jsで文字列のsha1ハッシュを取得するにはどうすればよいですか?
-
[解決済み] JSHintの'+'前の改行不良の説明
-
[解決済み] <ng-content>が空かどうかを確認する方法は?(これまでのAngular 2+で)
-
[解決済み] これは純関数ですか?
-
[解決済み] JavaScriptデータフォーマット/プリティプリンタ