2016-10-10 2 views
25

2 주 동안 만지지 않은 프로젝트가 있습니다. 나는 그것을 되 찾으려고 노력한다. npm start 나는이 오류를 가지고있다.create-react-app에서 npm 시작 오류가 발생했습니다.

> 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
  • 맥 시에라 10.12

package.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" 
    } 
} 

내가 너무 내 REPOS를 복제하려고 같은 오류가 발생합니다. 누군가가 내게 어떤 일이 일어나는지 찾아 낼 수 있다면. 고맙습니다.

+1

'node_modules'을 제거하고'npm install'을 다시 실행 해 보았습니까? – Nitsew

+1

예 node_modules를 정리하고 npm을 설치합니다. npm 설치시 오류가 없습니다. – EQuimper

+0

이 명령은'rm -rf node_modules/&& npm cache clean && npm install'을 사용했습니다. – EQuimper

답변

82

저자 앱은 체크인 반작용 만들기

당신을. 절대적으로 react-scripts을 설치해서는 안됩니다.
./node_modules/react-scripts/bin/, package.jsonthis answer을 의미합니다.

이 표시되면 :

npm ERR! [email protected] start: `react-scripts start` 
npm ERR! spawn ENOENT 

그냥 뭔가 종속성을 처음 설치할 때 잘못된 것을 의미한다.

나는이 세 단계를 수행하는 것이 좋습니다 : 가끔 버그가 있기 때문에

  1. npm install -g [email protected]이 NPM을 업데이트 할 수 있습니다.
  2. rm -rf node_modules 기존 모듈을 제거하십시오.
  3. npm install 프로젝트 종속성을 다시 설치하십시오.

이렇게하면 문제가 해결됩니다.
그렇지 않은 경우 프로젝트 및 노드 및 npm 버전에 대한 링크가 포함 된 file an issue을 입력하십시오.

+2

그 작품을 고맙다;) – EQuimper

+0

그것은 나를 위해 작동하지 않았다. npm v3.3.1; 노드 v6.9.1. 나는 Windows에있어이 문제는 몇 주 후에 다른 문제를 해결하기 위해 시스템을 복원 한 후에 시작되었습니다. – MartinDuo

+0

추신 : 단계를 실행하면이 오류가 발생합니다. 'rm'은 내부 또는 외부 명령으로 인식되지 않습니다. 시스템 복원은이 노드 명령을 실행하는 데 필요한 것을 제거했다고 생각하지만 실마리가 없습니다. – MartinDuo

4

귀하의 지구 환경에 react-scripts이없는 것처럼 보입니다. 두 가지 가능성이 여기에 사용할 수 있습니다 npm install -g react-scripts

또는 package.json에

이 같은 스크립트 부분을 변경의

"scripts": { 
    "start": "./node_modules/react-scripts/bin/react-scripts.js start", 
    "start:prod": "pushstate-server build", 
    "build": "./node_modules/react-scripts/bin/react-scripts.js build", 
    "test": "./node_modules/react-scripts/bin/react-scripts.js test --env=jsdom", 
    "eject": "./node_modules/react-scripts/bin/react-scripts.js eject", 
    "server": "cd client/api && pm2 start server.js --watch", 
    "proxy": "http://128.199.139.144:3000" 
    }, 
+0

이제 public.hir에서 create-react-app 검색과 같은 index.html 문제가 발생 했습니까? 하지만 전에는 그것을 얻지 못합니다. – EQuimper

+1

변경 내역을 확인하십시오.) https://github.com/facebookincubator/create-react-app/blob/master/CHANGELOG.md#050-september-23-2016 –

+0

다시 감사합니다. – EQuimper

1

예 반응 스크립트를 전역으로 설치하면 안됩니다. 작동하지 않습니다.

내가 내가 먼저 (다른 시스템에서) 프로젝트를 만들 때이 문제를 해결 나에게 그래서는 --save을 사용하지 않은 생각 :

npm install --save react react-dom react-scripts 
-1

가 가능 다른 라이브러리와 충돌, node_modules를 삭제하고 npm install을 다시 실행하십시오.

0

이 명령을 termux에서 실행하기 만하면됩니다.

pkg install termux-exec proot 
관련 문제