Depois de rodar o npm install no arquivo do projeto que baixei do git hub, que vocês disponibilizaram aqui, eu tentei usar o 'npm start', e recebi esse erro:
E:\alura\react-pt3\last-version>npm start
> instalura-ssr@0.0.1 start E:\alura\react-pt3\last-version
> if test "$NODE_ENV" = "production"; then npm run prod; else gulp dev; fi
"$NODE_ENV" foi inesperado neste momento.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! instalura-ssr@0.0.1 start: `if test "$NODE_ENV" = "production"; then npm run prod; else gulp dev; fi`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the instalura-ssr@0.0.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\MarceloPN\AppData\Roaming\npm-cache\_logs\2019-08-22T18_58_52_597Z-debug.log
E:\alura\react-pt3\last-version>
Como procedo?
Esse é o conteúdo do log:
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'start' ]
2 info using npm@6.9.0
3 info using node@v10.16.3
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle instalura-ssr@0.0.1~prestart: instalura-ssr@0.0.1
6 info lifecycle instalura-ssr@0.0.1~start: instalura-ssr@0.0.1
7 verbose lifecycle instalura-ssr@0.0.1~start: unsafe-perm in lifecycle true
8 verbose lifecycle instalura-ssr@0.0.1~start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;E:\alura\react-pt3\last-version\node_modules\.bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\Program Files\MySQL\MySQL Utilities 1.6\;C:\Program Files\MySQL\MySQL Server 5.7\bin;C:\Program Files\nodejs\;C:\Ruby25-x64\bin;C:\Program Files\MySQL\MySQL Shell 8.0\bin\;C:\Users\MarceloPN\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\MarceloPN\AppData\Roaming\npm
9 verbose lifecycle instalura-ssr@0.0.1~start: CWD: E:\alura\react-pt3\last-version
10 silly lifecycle instalura-ssr@0.0.1~start: Args: [ '/d /s /c',
10 silly lifecycle 'if test "$NODE_ENV" = "production"; then npm run prod; else gulp dev; fi' ]
11 silly lifecycle instalura-ssr@0.0.1~start: Returned: code: 1 signal: null
12 info lifecycle instalura-ssr@0.0.1~start: Failed to exec start script
13 verbose stack Error: instalura-ssr@0.0.1 start: `if test "$NODE_ENV" = "production"; then npm run prod; else gulp dev; fi`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:198:13)
13 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:198:13)
13 verbose stack at maybeClose (internal/child_process.js:982:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid instalura-ssr@0.0.1
15 verbose cwd E:\alura\react-pt3\last-version
16 verbose Windows_NT 10.0.17134
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v10.16.3
19 verbose npm v6.9.0
20 error code ELIFECYCLE
21 error errno 1
22 error instalura-ssr@0.0.1 start: `if test "$NODE_ENV" = "production"; then npm run prod; else gulp dev; fi`
22 error Exit status 1
23 error Failed at the instalura-ssr@0.0.1 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
No arquivo package.json na parte "scripts" tá assim:
"scripts": {
"start": "if test \"$NODE_ENV\" = \"production\"; then npm run prod; else gulp dev; fi",
"test": "gulp check",
"coverage": "gulp check",
"prod": "echo 'Starting standalone server in PROD mode'; node .",
"heroku-postbuild": "gulp build"
}