npm ERR! ELIFECYCLE kodi

Men reaktsiyani o'rganishga harakat qilayapman, shuning uchun to'liq kodli ovoz yozish dasturiga ega bo'lgan namunaviy kod bor, va uni ishga tushirishga harakat qilaman, ammo npm o'rnatishni keyin npm boshlanganidan so'ng quyidagi xatolarni qabul qilaman:

npm ERR! Darwin 16.4.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "server"
npm ERR! node v7.5.0
npm ERR! npm  v4.3.0
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] server: `live-server --public --    
host=localhost --port=3000 --middleware=./disable-browser-cache.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] server script 'live-server --
public --host=localhost --port=3000 --middleware=./disable-browser- 
cache.js'.
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 voting_app  
package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     live-server --public --host=localhost --port=3000 --  
middleware=./disable-browser-cache.js
npm ERR! You can get information on how to open an issue for this  
project with:
npm ERR!     npm bugs voting_app
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls voting_app
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/ItsMeMrLi/.npm/_logs/2017-02-17T22_48_03_581Z-
debug.log

npm ERR! Darwin 16.4.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v7.5.0
npm ERR! npm  v4.3.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `npm run server`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'npm run server'.
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 voting_app    
package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run server

npm ERR! You can get information on how to open an issue for this   
project with:
npm ERR!     npm bugs voting_app
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls voting_app
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/ItsMeMrLi/.npm/_logs/2017-02-17T22_48_03_655Z-
debug.log

Mana mening package.json:

{
  "name": "voting_app",
  "version": "1.1.0",
  "author": "Fullstack.io",
  "scripts": {
    "go": "open http://localhost:3000; npm run server",
    "e2e": "nightwatch",
    "test": "./node_modules/.bin/concurrently -k 'npm run server' 'npm  
run e2e'",
    "start": "npm run server",
    "server": "live-server public --host=localhost --port=3000 --  
middleware=./disable-browser-cache.js"
  },
  "private": true,
  "devDependencies": {
  "concurrently": "2.2.0",
  "live-server": "git://github.com/acco/live-server.git"
},
  "dependencies": {
  "semantic-ui": "git://github.com/Semantic-Org/Semantic-
  UI.git#27d58a01793b66318478fbc5b6676804d22d065d"
  }
}

Va nihoyat mening log faylim:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]~prestart: [email protected]
6 silly lifecycle [email protected]~prestart: no script for prestart, continuing
7 info lifecycle [email protected]~start: [email protected]
8 verbose lifecycle [email protected]~start: unsafe-perm in lifecycle true
9 verbose lifecycle [email protected]~start: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/ItsMeMrLi/Downloads/fullstack-react-code/voting_app/node_modules/.bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/Users/ItsMeMrLi/.rvm/gems/ruby-2.3.1/bin:/Users/ItsMeMrLi/.rvm/gems/[email protected]/bin:/Users/ItsMeMrLi/.rvm/rubies/ruby-2.3.1/bin:/Users/ItsMeMrLi/.cargo/bin:/usr/local/Cellar/smlnj/110.74/libexec/bin:/usr/local/bin:/Users/ItsMeMrLi/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Postgres.app/Contents/Versions/latest/bin:/Downloads/geckodriver:/usr/local/bin:/Users/ItsMeMrLi/.rvm/bin
10 verbose lifecycle [email protected]~start: CWD: /Users/ItsMeMrLi/Downloads/fullstack-react-code/voting_app
11 silly lifecycle [email protected]~start: Args: [ '-c', 'npm run server' ]
12 silly lifecycle [email protected]~start: Returned: code: 1  signal: null
13 info lifecycle [email protected]~start: Failed to exec start script
14 verbose stack Error: [email protected] start: `npm run server`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter. (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:279:16)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at EventEmitter.emit (events.js:192:7)
14 verbose stack     at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at ChildProcess.emit (events.js:192:7)
14 verbose stack     at maybeClose (internal/child_process.js:890:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid [email protected]
16 verbose cwd /Users/ItsMeMrLi/Downloads/fullstack-react-code/voting_app
17 error Darwin 16.4.0
18 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
19 error node v7.5.0
20 error npm  v4.3.0
21 error code ELIFECYCLE
22 error errno 1
23 error [email protected] start: `npm run server`
23 error Exit status 1
24 error Failed at the [email protected] start script 'npm run server'.
24 error Make sure you have the latest version of node.js and npm installed.
24 error If you do, this is most likely a problem with the voting_app package,
24 error not with npm itself.
24 error Tell the author that this fails on your system:
24 error     npm run server
24 error You can get information on how to open an issue for this project with:
24 error     npm bugs voting_app
24 error Or if that isn't available, you can get their info via:
24 error     npm owner ls voting_app
24 error There is likely additional logging output above.
25 verbose exit [ 1, true ]

Barcha ajoyib dasturchilarga rahmat.

47
Xristian @ Y'Eli, siz qanday qilib uni hal qildingiz?
qo'shib qo'ydi muallif imsrgadich, manba
Drayvda bo'sh joy ham mavjudligiga ishonch hosil qiling.
qo'shib qo'ydi muallif Mircea, manba

14 javoblar

Step 1: npm cache clean --force

2-qadam: node_modules o'chirilsin papkasida

Step 3: npm install

Bu men uchun ishladi. Umid qilamanki, u siz uchun ham ishlaydi.

21
qo'shib qo'ydi

Avvalo chop qildim: npm ishlayotgan toza (xatolar bilan birga bo'lsa ham) Keyin node_modules papkasini o'chirib tashladim: npm install Bu muammoni hal qilgan bo'lsa kerak.

12
qo'shib qo'ydi

Node_modules katalogiga kirishni o'zgartiring

chmod -R a+rwx ./node_modules 
11
qo'shib qo'ydi
Bu asosan ishlamadi.
qo'shib qo'ydi muallif pacanga, manba

npm keshni tozalash bilan ishlaydigan ushbu xatoni tuzatdim, keyin loyiha tuzilmasidan node_modules katalogini o'chirib tashlang.

After That install dependencies again using npm install

3
qo'shib qo'ydi
Yordam berildi! Rahmat!
qo'shib qo'ydi muallif DmitryKanunnikoff, manba
Men kabi yangi boshlanuvchilar uchun javobni ishlab chiqsangiz, chindan ham yordam berishi mumkin. Qopqinlik yaxshi, lekin har doim yordam bermaydi. Rahmat.
qo'shib qo'ydi muallif imsrgadich, manba
Men uchun ishladi!
qo'shib qo'ydi muallif Ankita P., manba
npm run clean hech qanday buyruq emas. Lekin, siz hali ham ishlayotgan g'oyangiz. Men o'chirildim va qayta o'rnatildim ... va boom ... ishladim .. thanks
qo'shib qo'ydi muallif Tarunn, manba

vaqtinchalik echim: Qulflangan faylni olib tashlang.

rm .\package-lock.json

manba: https://github.com/mapbox/node-pre-gyp/ muammolar/298 (floriantraber)

3
qo'shib qo'ydi
Bu ishlamayapti
qo'shib qo'ydi muallif Raphael ABADIE-MOREAU, manba

buyruqni superuser sifatida ishga tushirish:

sudo npm x-command
3
qo'shib qo'ydi
Ushbu javob nima uchun bu buyruqni ishlatish uchun foydali bo'lishini tushuntirmaydi. Iltimos, bu nima uchun to'g'ri echim bo'lishi mumkinligi haqida batafsil ma'lumot bera olasizmi?
qo'shib qo'ydi muallif Arnaud Leymet, manba

create-reactive-app ( havola ). Men 512MB RAMdan 1GB ($ 5/mo dan $ 10/mo) gacha ko'tarilganman va skript ishga tushirildi.

Men mana bu xatoni manba cheklovlari tufayli olishingiz mumkinligini ko'rsatmoqchiman. Bu men sayt sahifalarida va SO javoblarida tushuntirilgani yo'q. Xato jurnallarida ko'rgan hech narsa menga bu yo'nalishga ishora qilmadi.

3
qo'shib qo'ydi

Node_modules va package-lock.json fayllarini o'chiring va npm o'rnatishni ishga tushiring. Bu erda juda yaxshi harakat qildi (loyiha ildizining ostidagi buyruqni bajaring):

rm -rf node_modules && rm ./package-lock.json && npm install
2
qo'shib qo'ydi

Kliplar to'plamini global ravishda qayta o'rnatishga harakat qiling. Mening vaziyatimda, xuddi shu xato xabarini olganimda, Vue.js o'qituvchisini sinab ko'rishga urindim. Men qilgan boshqa narsa vue buyrug'ini qayta ishlatishdi, lekin bu safar webpack-oddiy foydalanib, shuning uchun muammoni hal qila olmayotganligiga amin emasman, hozir esa u ishlaydi.

1
qo'shib qo'ydi

Men ushbu xatoni hal qildim, iltimos, quyidagi buyruqlarni kiriting

npm install -g express-generator
express --view=hbs /tmp/foo && cd /tmp/foo
npm install
npm start
1
qo'shib qo'ydi

Cache va Node_module tozalash etarli emas. Quyidagi amallarni bajaring:

  • npm keshni tozalash - qoida
  • node_modules papkasini o'chirish
  • package-lock.jso n faylini o'chirish
  • npm o'rnatish

Bu men uchun shunday ishlaydi.

1
qo'shib qo'ydi

Mening ishimda yangi kutubxona bilan boshqa filialni tekshirdim. Men faqatgina npm o'rnatish tizimini ishga tushirib, boshqa hech narsa qilmasdan muammomni aniqladim. Men portdan foydalanilmaganda nima uchun ELIFECYCLE xatini olganligim shubhalangan edi, lekin men kutubxonani o'rnatmaganligim sababli bo'lishi kerak edi. Shunday qilib, muammoni bartaraf etish uchun siz node_modules kodini o'chirishingiz shart emas.

0
qo'shib qo'ydi

Shu kabi hal qilindi:

# chown -R : node_modules
0
qo'shib qo'ydi

Quyidagi xabarga duch kelsangiz, portning mavjudligini tekshiring:

Error: listen EACCES 127.0.0.1:8080

at Object._errnoException (util.js:999:13)
at _exceptionWithHostPort (util.js:1020:20)
at Server.setupListenHandle [as _listen2] (net.js:1362:19)
at listenInCluster (net.js:1420:12)
at GetAddrInfoReqWrap.doListen [as callback] (net.js:1535:7)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:102:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
0
qo'shib qo'ydi
NodeJS Uzbekistan
NodeJS Uzbekistan
152 ishtirokchilar

Guruh NodeJS bo'yicha muloqot qilish uchun ochilgan. Sizni qiziqtirsa: @nodejs_uz @react_uz @angular_uz @yiiframework_uz @js_uzb @typescript_uzb @vuejs_uz @ngTashkent @laravel_uz @uzdevgroup Ish o'rinlari @UzDev_jobs