2016-10-10 19 views
25

के साथ त्रुटि प्रारंभ करें मेरे पास एक प्रोजेक्ट है जिसे मैंने 2 सप्ताह तक स्पर्श नहीं किया था। मैं इसे वापस ले जाता हूं और अब जब मैं npm start चलाने की कोशिश करता हूं तो मुझे यह त्रुटि मिली।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" 
    } 
} 

मैं भी मेरी रेपोस क्लोन करने के लिए कोशिश करते हैं और एक ही त्रुटि प्राप्त करें। अगर कोई मुझे यह जानने के लिए कुछ रास्ता दे सकता है कि क्या होता है। धन्यवाद

+1

क्या आपने अपने 'node_modules' को हटाने और फिर से' npm इंस्टॉल' चलाने की कोशिश की है? – Nitsew

+1

हां मैं node_modules और npm इंस्टॉल को साफ़ करता हूं। मुझे एनपीएम इंस्टॉल में कोई त्रुटि नहीं मिली। – EQuimper

+0

मैंने इस कमांड का उपयोग किया है 'rm -rf node_modules/&& npm cache clean && npm install' – EQuimper

उत्तर

82

के लेखक App में जाँच प्रतिक्रिया बनाएं

आप। बिल्कुल वैश्विक स्तर पर 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

इससे समस्या ठीक होनी चाहिए।
यदि ऐसा नहीं है, तो कृपया file an issue को अपनी परियोजना और नोड और एनपीएम के संस्करणों के लिंक के साथ।

+2

धन्यवाद कि आप काम करते हैं;) – EQuimper

+0

यह मेरे लिए काम नहीं करता है। एनपीएम v3.3.1; नोड v6.9.1। मैं विंडोज़ पर हूं और यह समस्या तब शुरू हुई जब मैंने सिस्टम को दूसरी समस्या को ठीक करने के लिए कुछ हफ्तों तक रोल करने के लिए बहाल किया। – MartinDuo

+0

पीएस .: अपने कदम चलाना, मुझे यह त्रुटि मिलती है। 'आरएम' को आंतरिक या बाहरी कमांड के रूप में पहचाना नहीं जाता है। मुझे लगता है कि सिस्टम बहाल इन नोड आदेशों को चलाने के लिए कुछ आवश्यक हटा दिया गया है, लेकिन मेरे पास कोई सुराग नहीं है। – 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

अब मुझे index.html के साथ समस्या मिली है जो सार्वजनिक डीआईआर में create-react-app खोज की तरह दिखता है? लेकिन इससे पहले कि मैं कभी नहीं मिलता। – 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 इंस्टॉल करें।

0

बस इस आदेश को टर्मक्स में निष्पादित करें और आप जाने के लिए अच्छे हैं।

pkg install termux-exec proot