Eu novamente rsrs
O que está acontecendo é o seguinte: Faço o deploy do meu projeto NuxtJS (utilizando servidor próprio dele) e ao observar o log observo dois eventos:
Primeiro evento:
Feb 24 16:54:46 npm ERR! /usr/src/app/.npm/_logs/2020-02-24T19_54_46_599Z-debug.log
Feb 24 16:54:46 npm ERR! A complete log of this run can be found in:
Feb 24 16:54:46
Feb 24 16:54:46 npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Feb 24 16:54:46 npm ERR! Failed at the meuprojeto-nuxt@1.0.0 start script.
Feb 24 16:54:46 npm ERR!
Feb 24 16:54:46 npm ERR! Exit status 126
Feb 24 16:54:46 npm ERR! meuprojeto-nuxt@1.0.0 start: nuxt start
Feb 24 16:54:46 npm ERR! errno 126
Feb 24 16:54:46 npm ERR! code ELIFECYCLE
Feb 24 16:54:46 sh: 1: nuxt: Permission denied
Feb 24 16:54:46
Feb 24 16:54:46 > nuxt start
Feb 24 16:54:46 > meuprojeto@1.0.0 start /usr/src/app
Logo após esse erro acontecer, ocorre outro evento em seguida:
Segundo evento:
Feb 24 16:54:57 Listening on: “myhost”
Feb 24 16:54:54
Feb 24 16:54:54 > nuxt start
Feb 24 16:54:54 > myproject-nuxt@1.0.0 start /usr/src/app
Conteúdo do log /usr/src/app/.npm/_logs/2020-02-24T19_54_46_599Z-debug.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 npm@6.9.0
3 info using node@v10.16.3
4 verbose config Skipping project config: /usr/src/app/.npmrc. (matches userconfig)
5 verbose run-script [ ‘prestart’, ‘start’, ‘poststart’ ]
6 info lifecycle meuprojeto-nuxt@1.0.0~prestart: meuprojeto-nuxt@1.0.0
7 info lifecycle meuprojeto-nuxt@1.0.0~start: meuprojeto-nuxt@1.0.0
8 verbose lifecycle meuprojeto-nuxt@1.0.0~start: unsafe-perm in lifecycle true
9 verbose lifecycle meuprojeto-nuxt@1.0.0~start: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/usr/src/app/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
10 verbose lifecycle meuprojeto-nuxt@1.0.0~start: CWD: /usr/src/app
11 silly lifecycle meuprojeto-nuxt@1.0.0~start: Args: [ ‘-c’, ‘nuxt start’ ]
12 silly lifecycle meuprojeto@1.0.0~start: Returned: code: 126 signal: null
13 info lifecycle meuprojeto@1.0.0~start: Failed to exec start script
14 verbose stack Error: meuprojeto@1.0.0 start: nuxt start
14 verbose stack Exit status 126
14 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
14 verbose stack at EventEmitter.emit (events.js:198:13)
14 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
14 verbose stack at ChildProcess.emit (events.js:198:13)
14 verbose stack at maybeClose (internal/child_process.js:982:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
15 verbose pkgid meuprojeto-nuxt@1.0.0
16 verbose cwd /usr/src/app
17 verbose Linux 4.15.0-1069-azure
18 verbose argv “/usr/local/bin/node” “/usr/local/bin/npm” “start”
19 verbose node v10.16.3
20 verbose npm v6.9.0
21 error code ELIFECYCLE
22 error errno 126
23 error meuprojeto@1.0.0 start: nuxt start
23 error Exit status 126
24 error Failed at the meuprojeto-nuxt@1.0.0 start script.
24 error This is probably not a problem with npm. There is likely additional logging output above.
25 verbose exit [ 126, true ]
package.json
{
“name”: “meuprojeto-nuxt”,
“version”: “1.0.0”,
“description”: “My phenomenal Nuxt.js project”,
“author”: “…”,
“private”: true,
“scripts”: {
“dev”: “nuxt”,
“build”: “nuxt build”,
“start”: “nuxt start”
},
“dependencies”: {
“@nuxtjs/google-analytics”: “^2.2.3”,
“@nuxtjs/sitemap”: “^2.0.1”,
“axios”: “^0.19.2”,
“nuxt”: “^2.11.0”,
“path”: “^0.12.7”
},
“devDependencies”: {}
}
Após o segundo evento acontecer, o meu site abre normalmente. Estou com dúvida se esse erro está afetando negativamente o meu projeto. Estou pensando nisso pois, quando eu executo um “yarn build” e depois “yarn start” para colocar o meu projeto no modo produção e testar localmente, não acontece nenhum erro no meu log local e o sitemap.xml é preenchido normalmente (biblioteca @nuxtjs/sitemap que gera automatico as minhas urls dinâmicas).
Agora, o projeto aqui na Umbler, o sitemap.xml fica vazio (sei que vocês não tem obrigação de entender sobre a biblioteca, mas para vocês se situarem, as urls “/page/parametro” são recebidos via api e gravados no sitemap.xml ao executar o “nuxt start”), tentei todas as alternativas que encontrei em forums sobre esse problema, e nada, então estou suspeitando que pode ser algo da hospedagem.
Obs: Utilizo yarn no meu projeto.