1
resposta

[Bug] Erro ao instalar alurapic pelo cmd

npm ERR! code 1
npm ERR! path C:\Users\yasmincampos\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\yasmincampos\Desktop\nvm\v16.13.1\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\yasmincampos\Desktop\alurapic\node_modules\sqlite3\lib\binding\napi-v6-win32-unknown-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=C:\Users\yasmincampos\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' (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\yasmincampos\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%2F20230922%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230922T210959Z&X-Amz-Expires=300&X-Amz-Signature=9bce49841a022202588de54a4cb40e059d0ad67293905cfedc76525ffc0a53cf&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%2F20230922%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230922T210959Z&X-Amz-Expires=300&X-Amz-Signature=9bce49841a022202588de54a4cb40e059d0ad67293905cfedc76525ffc0a53cf&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.11.5 found at "C:\Users\yasmincampos\AppData\Local\Programs\Python\Python311\python.exe"
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
npm ERR! gyp ERR! find VS including the "Desktop development with C++" workload.
npm ERR! gyp ERR! find VS For more information consult the documentation at:
npm ERR! gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Could not find any Visual Studio installation to use
npm ERR! gyp ERR! stack     at VisualStudioFinder.fail (C:\Users\yasmincampos\Desktop\nvm\v16.13.1\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
npm ERR! gyp ERR! stack     at C:\Users\yasmincampos\Desktop\nvm\v16.13.1\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:16
npm ERR! gyp ERR! stack     at VisualStudioFinder.findVisualStudio2013 6
1 resposta

Olá, Yasmin! Tudo bem com você?

O erro que você está vendo geralmente ocorre quando o npm tenta compilar um módulo nativo, neste caso o sqlite3, mas não consegue encontrar uma instalação do Visual Studio em seu computador.

Aqui estão algumas sugestões que podem ajudar a resolver o problema:

1 - Instale o Visual Studio: O erro sugere que o Visual Studio não está instalado em seu computador. Você pode baixar e instalar a última versão do Visual Studio aqui. Certifique-se de incluir a carga de trabalho "Desenvolvimento para desktop com C++" durante a instalação, pois é necessário para compilar módulos nativos.

2 - Instale o pacote windows-build-tools: Este pacote instala as ferramentas de compilação do Visual Studio e o Python, necessários para compilar módulos nativos do Node.js. Você pode instalar este pacote executando o comando npm install --global windows-build-tools no prompt de comando com privilégios de administrador.

Por fim, após seguir essas sugestões, tente instalar o alurapic novamente.

Contudo, se mesmo com essas dicas não funcione, lhe indico utilizar o link onde AluraPic está upado na Web e que funcionará para os seus testes automatizados, igualmente como o instalado local.

Espero ter ajudado e bons estudos!

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