node.js - the - verbose npm v5 6.0 20 error code elifecycle
npm ERR! código ELIFECYCLE (14)
Eu estou tentando aprender reagir, então eu tenho esse código de exemplo para o fullstack reagir aplicativo de votação, e eu estou tentando fazer o trabalho, mas depois de executar a instalação do npm seguido de npm start recebo o seguinte erro:
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].1.0 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].1.0 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].1.0 start: `npm run server`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected].1.0 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
Aqui está o meu pacote.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"
}
}
E finalmente meu arquivo de log:
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.0
3 info using [email protected].5.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected].1.0~prestart: [email protected].1.0
6 silly lifecycle [email protected].1.0~prestart: no script for prestart, continuing
7 info lifecycle [email protected].1.0~start: [email protected].1.0
8 verbose lifecycle [email protected].1.0~start: unsafe-perm in lifecycle true
9 verbose lifecycle [email protected].1.0~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/ruby-2.3.[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].1.0~start: CWD: /Users/ItsMeMrLi/Downloads/fullstack-react-code/voting_app
11 silly lifecycle [email protected].1.0~start: Args: [ '-c', 'npm run server' ]
12 silly lifecycle [email protected].1.0~start: Returned: code: 1 signal: null
13 info lifecycle [email protected].1.0~start: Failed to exec start script
14 verbose stack Error: [email protected].1.0 start: `npm run server`
14 verbose stack Exit status 1
14 verbose stack at EventEmitter.<anonymous> (/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.<anonymous> (/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].1.0
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].1.0 start: `npm run server`
23 error Exit status 1
24 error Failed at the [email protected].1.0 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 ]
Obrigado a todos vocês, programadores impressionantes.
Alterar o acesso no diretório node_modules
chmod -R a+rwx ./node_modules
Certifique-se de usar a versão mais recente do npm ao instalar pacotes usando npm.
Ao instalar o JavaScript, mencione a versão mais recente do NodeJS. Por exemplo, ao instalar o JavaScript usando o devtools, use o código abaixo:
devtools i --javascript nodejs:10.15.1
Isso fará o download e instalará a versão mencionada do NodeJS. Isso funcionou para mim.
Esta solução corrigiu o erro no Win10.
Por favor, instale globalmente
npm install -g node-pre-gyp
Estou usando
react-create-app
no Windows 10, em 2 de fevereiro de 2019 com o mais recente NodeJS 11.9.0 e npm 6.7.0 (quando você instala o NodeJS, o
npm
é existente).
Eu acho que caso de pacotes de nós estão corrompidos, raramente, a principal causa de permissão.
No começo, eu coloquei o diretório do projeto no Desktop, ele pertence ao
C:\
driver.
Eu mudo para outro diretório de outro driver.
Portanto, eu removo a preocupação de "permissão de arquivo".
Todo trabalho bem e simples.
cd /d D:\
mkdir temp20190202
npx create-react-app my-app
cd my-app
npm start
Está tudo bem, não coloque pasta de projeto em um diretório de
C:\
(ou outro driver que contém o sistema operacional Windows).
Eu estava recebendo mensagens de erro semelhantes em uma instância do Ubuntu 16.04 com DigitalOcean enquanto executava
npm run build
em um aplicativo feito com
create-react-app
npm run build
create-react-app
(
link
).
Eu atualizei a instância de 512MB RAM para 1GB ($ 5 / mo para $ 10 / mo) e, em seguida, o script foi capaz de executar.
Eu posto isto aqui para apontar que você pode obter este erro devido a limitações de recursos, o que eu realmente não vi explicado em outras páginas do problema e respostas SO. E nada que eu vi nos logs de erro me apontou nessa direção.
Eu resolvo esse erro executando
npm cache clean
e
node_modules
diretório
node_modules
da minha estrutura de projeto.
Depois que instalar as dependências novamente usando o
npm install
Eu tive o mesmo problema com o Angular 7. Apenas passei pelos seguintes passos e o erro foi resolvido.
1). Exclua sua pasta node_modules e o arquivo package-lock.json .
2).
Execute o comando
npm install
.
3).
Execute o comando
npm audit fix
.
Exclua node_modules e package-lock.json e, em seguida, execute npm install. Funcionou perfeitamente aqui (execute o comando abaixo dentro do projeto root):
rm -rf node_modules && rm ./package-lock.json && npm install
Resolvi este erro, por favor, digite os seguintes comandos
npm install -g express-generator
express --view=hbs /tmp/foo && cd /tmp/foo
npm install
npm start
Resolvido assim:
# chown -R <user>: node_modules
Verifique a disponibilidade da porta também se você encontrar abaixo da mensagem:
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
execute o comando como superusuário:
sudo npm x-command
solução alternativa: remova o arquivo de bloqueio.
rm .\package-lock.json
fonte: https://github.com/mapbox/node-pre-gyp/issues/298 (floriantraber)
Cache
Limpeza e
Node_module
não são suficientes.
Siga estes passos:
-
npm cache clean --force
-
excluir a pasta
node_modules
-
Exclua o arquivo
package-lock.json
-
npm install
Isso funciona para mim assim.