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

Erro ou executar npm install na API

Olá, estou tentando executar npm install na API. Ela baixa alguns pacotes porém depois apresentar vários erros.

> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.0.0/node-v64-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for sqlite3@4.0.0 and node@10.16.3 (node-v64 ABI, unknown) (falling back to source compile with node-gyp)
gyp ERR! find Python
gyp ERR! find Python Python is not set from command line or npm configuration
gyp ERR! find Python Python is not set from environment variable PYTHON
gyp ERR! find Python checking if "python" can be used
gyp ERR! find Python - "python" is not in PATH or produced an error
gyp ERR! find Python checking if "python2" can be used
gyp ERR! find Python - "python2" is not in PATH or produced an error
gyp ERR! find Python checking if the py launcher can be used to find Python 2
gyp ERR! find Python - "py.exe" is not in PATH or produced an error
gyp ERR! find Python checking if Python is C:\Python27\python.exe
gyp ERR! find Python - "C:\Python27\python.exe" could not be run
gyp ERR! find Python checking if Python is C:\Python37\python.exe
gyp ERR! find Python - "C:\Python37\python.exe" could not be run
gyp ERR! find Python
gyp ERR! find Python **********************************************************
gyp ERR! find Python You need to install the latest version of Python 2.7.
gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
gyp ERR! find Python you can try one of the following options:
gyp ERR! find Python - Use the switch --python="C:\Path\To\python.exe"
gyp ERR! find Python   (accepted by both node-gyp and npm)
gyp ERR! find Python - Set the environment variable PYTHON
gyp ERR! find Python - Set the npm configuration variable python:
gyp ERR! find Python   npm config set python "C:\Path\To\python.exe"
gyp ERR! find Python For more information consult the documentation at:
gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
gyp ERR! find Python **********************************************************
gyp ERR! find Python
gyp gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
ERR! configure error
gyp ERR! stack Error: Could not find any Python installation to use
gyp ERR! stack     at PythonFinder.fail
 `
4 respostas

Bianca,

Você precisa ter a versão 2.7 do Python instalado em sua maquina, caso não tenha instalado ainda, você pode fazer o download dele no site oficial: python.org.

Caso já tenha instalado, é importante adicionar nas variáveis do sistema o caminho de instalação do Python não somente para uso node-gyp mais evitar futuras dores de cabeça. Mas o pacote da a opção de você passar como parâmetro o caminho de instalação do Python:

node-pre-gyp install --python C:\DiretorioDeInstacao\python2.7 --fallback-to-build 

ou via npm:

npm config set python C:\DiretorioDeInstacao\python2.7

depois tente executar novamente, para mais informações acesse o repositório do node-gyp no GitHub.

solução!

Já consegui corrigir o problema. O node instalado na minha máquina era o node 10, por isso tava dando conflitos.

Qual é a versão do node que precisa estar instalada?

Eu instalei a versão 8.1.11 Vinicius, aqui deu certo cara. Segue link no node: https://nodejs.org/ja/blog/release/v8.11.1/

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software