Solucionado (ver solução)
Solucionado
(ver solução)
6
respostas

Não consigo instalar o projeto

PS C:\Users\talle\Área de Trabalho\blog-do-codigo-aula-0> npm install

sqlite3@4.2.0 install C:\Users\talle\Área de Trabalho\blog-do-codigo-aula-0\node_modules\sqlite3 node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using needle for node-pre-gyp https download node-pre-gyp WARN Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.2.0/node-v83-win32-x64.tar.gz node-pre-gyp WARN Pre-built binaries not found for sqlite3@4.2.0 and node@14.15.0 (node-v83 ABI, unknown) (falling back to source compile with node-gyp) Traceback (most recent call last): File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\gyp_main.py", line 50, in sys.exit(gyp.script_main()) File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp_init__.py", line 554, in scriptmain return main(sys.argv[1:]) File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp_init__.py", line 547, in main return gypmain(args) File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp_init__.py", line 532, in gypmain generator.GenerateOutput(flat_list, targets, data, params) File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", line 2008, in GenerateOutput msvs_version) File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", line 1843, in CreateProjectObjects guid = _GetGuidOfProject(projpath, spec) File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", line 910, in GetGuidOfProject guid = guid or MSVSNew.MakeGuid(projpath) File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\MSVSNew.py", line 48, in MakeGuid d = hashlib.md5((str(seed) + str(name)).encode('utf-8')).hexdigest().upper() UnicodeDecodeError: 'ascii' codec can't decode byte 0xc1 in position 23: ordinal not in range(128) gyp ERR! configure error gyp ERR! stack Error: gyp failed with exit code: 1 gyp ERR! stack at ChildProcess.onCpExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:351:16) gyp ERR! stack at ChildProcess.emit (events.js:315:20) gyp ERR! stack at Process.ChildProcess.handle.onexit (internal/childprocess.js:277:12) gyp ERR! System Windows_NT 10.0.18363 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\Users\talle\Área de Trabalho\blog-do-codigo-aula-0\node_modules\sqlite3\lib\binding\node-v83-win32-x64\node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=C:\Users\talle\Área de Trabalho\blog-do-codigo-aula-0\node_modules\sqlite3\lib\binding\node-v83-win32-x64" "--napi_version=7" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v83" "--python=C:\Users\talle\.windows-build-tools\python27\python.exe" gyp ERR! cwd C:\Users\talle\Área de Trabalho\blog-do-codigo-aula-0\node_modules\sqlite3 gyp ERR! node -v v14.15.0 gyp ERR! node-gyp -v v5.1.0 gyp ERR! not ok node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\talle\Área de Trabalho\blog-do-codigo-aula-0\node_modules\sqlite3\lib\binding\node-v83-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=C:\Users\talle\Área de Trabalho\blog-do-codigo-aula-0\node_modules\sqlite3\lib\binding\node-v83-win32-x64 --napi_version=7 --

6 respostas

gyp ERR! configure error gyp ERR! stack Error: gyp failed with exit code: 1 gyp ERR! stack at ChildProcess.onCpExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:351:16) gyp ERR! stack at ChildProcess.emit (events.js:315:20) gyp ERR! stack at Process.ChildProcess.handle.onexit (internal/childprocess.js:277:12) gyp ERR! System Windows_NT 10.0.18363 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\Users\talle\Área de Trabalho\blog-do-codigo-aula-0\node_modules\sqlite3\lib\binding\node-v83-win32-x64\node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=C:\Users\talle\Área de Trabalho\blog-do-codigo-aula-0\node_modules\sqlite3\lib\binding\node-v83-win32-x64" "--napi_version=7" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v83" "--python=C:\Users\talle\.windows-build-tools\python27\python.exe" gyp ERR! cwd C:\Users\talle\Área de Trabalho\blog-do-codigo-aula-0\node_modules\sqlite3 gyp ERR! node -v v14.15.0 gyp ERR! node-gyp -v v5.1.0 gyp ERR! not ok

ailed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\talle\Área de Trabalho\blog-do-codigo-aula-0\node_modules\sqlite3\lib\binding\node-v83-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=C:\Users\talle\Área de Trabalho\blog-do-codigo-aula-0\node_modules\sqlite3\lib\binding\node-v83-win32-x64 --napi_version=7 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83 --python=C:\Users\talle.windows-build-tools\python27\python.exe' (1) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules\chokidar\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm WARN blog-do-codigo@1.0.0 No repository field.

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! sqlite3@4.2.0 install: node-pre-gyp install --fallback-to-build npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the sqlite3@4.2.0 install 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\talle\AppData\Roaming\npm-cache_logs\2020-10-29T01_54_02_923Z-debug.log

Oi, Talles!

É um erro estranho mesmo. Vai na pasta do projeto e tenta deletar a pasta node_modules e o arquivo package-lock.json.

Aí em seguida tenta executar

npm install

Então, depois que atualizei o package, deu certo, o npm install funcionou.

Agora estou tentando rodar com npm start, e ele está dando erro no redis

nodemon server.js

[nodemon] 2.0.6 [nodemon] to restart at any time, enter rs [nodemon] watching path(s): . [nodemon] watching extensions: js,mjs,json [nodemon] starting node server.js events.js:292 throw er; // Unhandled 'error' event ^

Error: connect ECONNREFUSED 127.0.0.1:6379 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16) Emitted 'error' event on RedisClient instance at: at RedisClient.on_error (C:\Users\talle\Área de Trabalho\blog-do-codigo-aula-0\node_modules\redis\index.js:341:14) at Socket.emit (events.js:315:20) at emitErrorNT (internal/streams/destroy.js:106:8) at emitErrorCloseNT (internal/streams/destroy.js:74:3) at processTicksAndRejections (internal/process/task_queues.js:80:21) { errno: -4078, code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 6379 } [nodemon] app crashed - waiting for file changes before starting...

Oi, Talles!

Parece que o programa não está conseguindo se conectar com o Redis.

Você chegou a fazer os passos de instalação do Redis no Windows no preparando o ambiente da aula 4?

Tenta rodar redis-cli no terminal e vê se funciona. Se ele disser que o comando não foi encontrado, reiniciar o computador geralmente resolve isso.

solução!

Então, achei o erro.

Eu baixei o projeto pelo github, se eu fizer o passo a passo, funciona!