3
respostas

[Dúvida] Erro ao instalar alurapic

Boa tarde, pessoal. Não estou conseguindo avançar na instalação do alurapic, estou me deparando com o erro. Podem me ajudar na solução?

npm ERR! code 1
npm ERR! path C:\Users\elainelopes\Desktop\alurapic\node_modules\sqlite3
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node-pre-gyp install --fallback-to-build
npm ERR! Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\elainelopes\AppData\Roaming\nvm\v16.13.1\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\elainelopes\Desktop\alurapic\node_modules\sqlite3\lib\binding\napi-v6-win32-unknown-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=C:\Users\elainelopes\Desktop\alurapic\node_modules\sqlite3\lib\binding\napi-v6-win32-unknown-x64 --napi_version=8 --node_abi_napi=napi --napi_build_version=6 --node_napi_label=napi-v6 --python=python3.12.0' (1)
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using node-pre-gyp@1.0.10
npm ERR! node-pre-gyp info using node@16.13.1 | win32 | x64
npm ERR! node-pre-gyp info check checked for "C:\Users\elainelopes\Desktop\alurapic\node_modules\sqlite3\lib\binding\napi-v6-win32-unknown-x64\node_sqlite3.node" (not found)
npm ERR! node-pre-gyp http GET https://github.com/TryGhost/node-sqlite3/releases/download/v5.1.6/napi-v6-win32-unknown-x64.tar.gz
npm ERR! node-pre-gyp ERR! install request to https://objects.githubusercontent.com/github-production-release-asset-2e65be/1367055/3a2d6cf2-c403-4fdc-a52c-b076ec1160a6?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20231005%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20231005T195936Z&X-Amz-Expires=300&X-Amz-Signature=56abf3163c49d1a331e7973252198a786573adb0dbbdc15c590fedc53ad5eacd&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=1367055&response-content-disposition=attachment%3B%20filename%3Dnapi-v6-win32-unknown-x64.tar.gz&response-content-type=application%2Foctet-stream failed, reason: self signed certificate in certificate chain
npm ERR! node-pre-gyp WARN Pre-built binaries not installable for sqlite3@5.1.6 and node@16.13.1 (node-v93 ABI, unknown) (falling back to source compile with node-gyp)
npm ERR! node-pre-gyp WARN Hit error request to https://objects.githubusercontent.com/github-production-release-asset-2e65be/1367055/3a2d6cf2-c403-4fdc-a52c-b076ec1160a6?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20231005%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20231005T195936Z&X-Amz-Expires=300&X-Amz-Signature=56abf3163c49d1a331e7973252198a786573adb0dbbdc15c590fedc53ad5eacd&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=1367055&response-content-disposition=attachment%3B%20filename%3Dnapi-v6-win32-unknown-x64.tar.gz&response-content-type=application%2Foctet-stream failed, reason: self signed certificate in certificate chain
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@8.3.0
npm ERR! gyp info using node@16.13.1 | win32 | x64
npm ERR! gyp info ok
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@8.3.0
npm ERR! gyp info using node@16.13.1 | win32 | x64
npm ERR! gyp info find Python using Python version 3.12.0 found at "C:\Users\elainelopes\AppData\Local\Programs\Python\Python312\python.exe"
npm ERR! gyp http GET https://nodejs.org/download/release/v16.13.1/node-v16.13.1-headers.tar.gz
npm ERR! gyp http 200 https://nodejs.org/download/release/v16.13.1/node-v16.13.1-headers.tar.gz
npm ERR! gyp http GET https://nodejs.org/download/release/v16.13.1/SHASUMS256.txt
npm ERR! gyp http GET https://nodejs.org/download/release/v16.13.1/win-x86/node.lib
npm ERR! gyp http GET https://nodejs.org/download/release/v16.13.1/win-x64/node.lib
npm ERR! gyp http GET https://nodejs.org/download/release/v16.13.1/win-arm64/node.lib
npm ERR! gyp http 200 https://nodejs.org/download/release/v16.13.1/SHASUMS256.txt
npm ERR! gyp http 200 https://nodejs.org/download/release/v16.13.1/win-x64/node.lib
npm ERR! gyp http 404 https://nodejs.org/download/release/v16.13.1/win-arm64/node.lib
npm ERR! gyp http 200 https://nodejs.org/download/release/v16.13.1/win-x86/node.lib
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS msvs_version not set from command line or npm config
npm ERR! gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
npm ERR! gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer, try re-running with '--loglevel silly' for more details
npm ERR! gyp ERR! find VS looking for Visual Studio 2015
npm ERR! gyp ERR! find VS - not found
npm ERR! gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studio
3 respostas

Olá, Elaine! Tudo bem?

O erro que você compartilhou indica que há um problema com o módulo sqlite3, que é uma dependência do projeto. Além disso, parece que há um problema com o certificado SSL ao tentar baixar os binários pré-compilados do sqlite3.

Vamos tentar resolver isso passo a passo:

  1. Verifique a versão do Node.js: o erro pode ocorrer devido a uma incompatibilidade de versão entre o Node.js e o sqlite3. No prompt de comando, você pode verificar a versão do Node.js com o comando node -v. A versão deve ser a 16.13.1, conforme mencionado na aula.

  2. Limpe o cache do npm: o npm, gerenciador de pacotes do Node.js, pode ter armazenado uma versão inválida do módulo sqlite3. Você pode limpar o cache com o comando npm cache clean --force.

  3. Instale o Visual Studio Build Tools: o erro também menciona que o Visual Studio Build Tools não foi encontrado. Este é um conjunto de ferramentas necessárias para compilar módulos nativos do Node.js, como o sqlite3. Você pode instalar o Visual Studio Build Tools com o comando npm install --global windows-build-tools.

  4. Reinstale o sqlite3: tente instalar o sqlite3 manualmente com o comando npm install sqlite3. Se isso funcionar, tente instalar as dependências do AluraPic novamente com npm install.

Por favor, tente esses passos e veja se algum deles resolve o problema. Lembre-se de executar o Prompt de Comando como administrador ao tentar esses passos.

Espero ter ajudado e bons estudos!

Caso este post tenha lhe ajudado, por favor, marcar como solucionado ✓.

Oi Armando. Segui o passo a passo orientado, mas não obtive sucesso. Quando tentei reinstalar o sqlite3 (npm install sqlite3), deu erro.

C:\Windows\System32>npm install sqlite3 npm WARN deprecated @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs npm ERR! code 1 npm ERR! path C:\Windows\System32\node_modules\sqlite3 npm ERR! command failed npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node-pre-gyp install --fallback-to-build npm ERR! Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\elainelopes\AppData\Roaming\nvm\v16.13.1\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Windows\System32\node_modules\sqlite3\lib\binding\napi-v6-win32-unknown-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=C:\Windows\System32\node_modules\sqlite3\lib\binding\napi-v6-win32-unknown-x64 --napi_version=8 --node_abi_napi=napi --napi_build_version=6 --node_napi_label=napi-v6 --python=python3.12.0' (1) npm ERR! node-pre-gyp info it worked if it ends with ok npm ERR! node-pre-gyp info using node-pre-gyp@1.0.11 npm ERR! node-pre-gyp info using node@16.13.1 | win32 | x64 npm ERR! node-pre-gyp info check checked for "C:\Windows\System32\node_modules\sqlite3\lib\binding\napi-v6-win32-unknown-x64\node_sqlite3.node" (not found) npm ERR! node-pre-gyp http GET https://github.com/TryGhost/node-sqlite3/releases/download/v5.1.6/napi-v6-win32-unknown-x64.tar.gz npm ERR! node-pre-gyp ERR! install request to https://objects.githubusercontent.com/github-production-release-asset-2e65be/1367055/3a2d6cf2-c403-4fdc-a52c-b076ec1160a6?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20231006%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20231006T195612Z&X-Amz-Expires=300&X-Amz-Signature=20a9a39121140c796e78dff700e54219017ddfa96aba078cf93a20916def0208&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=1367055&response-content-disposition=attachment%3B%20filename%3Dnapi-v6-win32-unknown-x64.tar.gz&response-content-type=application%2Foctet-stream failed, reason: self signed certificate in certificate chain npm ERR! node-pre-gyp WARN Pre-built binaries not installable for sqlite3@5.1.6 and node@16.13.1 (node-v93 ABI, unknown) (falling back to source compile with node-gyp) npm ERR! node-pre-gyp WARN Hit error request to https://objects.githubusercontent.com/github-production-release-asset-2e65be/1367055/3a2d6cf2-c403-4fdc-a52c-b076ec1160a6?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20231006%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20231006T195612Z&X-Amz-Expires=300&X-Amz-Signature=20a9a39121140c796e78dff700e54219017ddfa96aba078cf93a20916def0208&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=1367055&response-content-disposition=attachment%3B%20filename%3Dnapi-v6-win32-unknown-x64.tar.gz&response-content-type=application%2Foctet-stream failed, reason: self signed certificate in certificate chain npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp@8.3.0 npm ERR! gyp info using node@16.13.1 | win32 | x64 npm ERR! gyp info ok npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp@8.3.0

Oi, Elaine. Bom dia!

Peço desculpa pela minha confusão, o passo 4 deveria vir primeiro da reinstalação do "sqlite3", fiz o ajuste da sequência na minha primeira postagem. Se os erros persistirem, talvez será necessário desinstalar e instalar novamente o Node em seu dispositivo.

Caso queira poupar tempo, indico-lhe utilizar para o decorrer do projeto o link do AluraPic publicado em Web.

Link: https://3076-cypress-alurapic-front.vercel.app/

Uma das diferenças de utilizar esse link para o que seria gerado ao rodar o projeto do AluraPic localmente, é que mais a frente você terá que utilizar uma API que esse site usa, logo você terá menos trabalho.

Espero ter ajudado e se tiver mais problemas, estarei à disposição para lhe ajudar.

Bons estudos!