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

Quando faz o npm start dá esse erro.

C:\WINDOWS\system32>npm start npm ERR! code ENOENT npm ERR! syscall open npm ERR! path C:\WINDOWS\system32\package.json npm ERR! errno -4058 npm ERR! enoent ENOENT: no such file or directory, open 'C:\WINDOWS\system32\package.json' npm ERR! enoent This is related to npm not being able to find a file. npm ERR! enoent

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\amand\AppData\Roaming\npm-cache_logs\2021-01-18T16_23_52_750Z-debug.log

7 respostas

Estou mais de 3 dias nesse Error, sem saber mais o que fazer.

C:\WINDOWS\system32>npm install --unsafe-perm -g sqlite3 npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 npm WARN deprecated har-validator@5.1.5: this library is no longer supported

sqlite3@5.0.1 install C:\Users\amand\AppData\Roaming\npm\node_modules\sqlite3 node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download node-pre-gyp WARN Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.1/napi-v6-win32-x64.tar.gz node-pre-gyp WARN Pre-built binaries not found for sqlite3@5.0.1 and node@14.15.1 (node-v83 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 "python3" can be used gyp ERR! find Python - "python3" 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. 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 ERR! configure error gyp ERR! stack Error: Could not find any Python installation to use gyp ERR! stack at PythonFinder.fail (C:\Node\node_modules\npm\node_modules\node-gyp\lib\find-python.js:307:47) gyp ERR! stack at PythonFinder.runChecks (C:\Node\node_modules\npm\node_modules\node-gyp\lib\find-python.js:136:21) gyp ERR! stack at PythonFinder. (C:\Node\node_modules\npm\node_modules\node-gyp\lib\find-python.js:225:16) gyp ERR! stack at PythonFinder.execFileCallback (C:\Node\node_modules\npm\node_modules\node-gyp\lib\find-python.js:271:16) gyp ERR! stack at exithandler (child_process.js:315:5) gyp ERR! stack at ChildProcess.errorhandler (child_process.js:327:5) gyp ERR! stack at ChildProcess.emit (events.js:315:20) gyp ERR! stack at Process.ChildProcess.handle.onexit (internal/childprocess.js:275:12) gyp ERR! stack at onErrorNT (internal/child_process.js:465:16) gyp ERR! stack at processTicksAndRejections (internal/process/task_queues.js:80:21) gyp ERR! System Windows_NT 10.0.19042 gyp ERR! command "C:\Node\node.exe" "C:\Node\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\Users\amand\AppData\Roaming\npm\node_modules\sqlite3\lib\binding\napi-v6-win32-x64\node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=C:\Users\amand\AppData\Roaming\npm\node_modules\sqlite3\lib\binding\napi-v6-win32-x64" "--napi_version=7" "--node_abi_napi=napi" "--napi_build_version=6" "--node_napi_label=napi-v6" gyp ERR! cwd C:\Users\amand\AppData\Roaming\npm\node_modules\sqlite3 gyp ERR! node -v v14.15.1 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:\Node\node.exe C:\Node\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\amand\AppData\Roaming\npm\node_modules\sqlite3\lib\binding\napi-v6-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=C:\Users\amand\AppData\Roaming\npm\node_modules\sqlite3\lib\binding\napi-v6-win32-x64 --napi_version=7 --node_abi_napi=napi --napi_build_version=6 --node_napi_label=napi-v6' (1) node-pre-gyp ERR! stack at ChildProcess. (C:\Users\amand\AppData\Roaming\npm\node_modules\sqlite3\node_modules\node-pre-gyp\lib\util\compile.js:83:29) node-pre-gyp ERR! stack at ChildProcess.emit (events.js:315:20)

Fala ai Amanda, tudo bem? Cada erro que você postou é diferente um do outro, pode ser sido gerado por diferentes comandos.

Vamos tentar recomeçar do zero, como você está criando o projeto em Angular, tudo certo nele através do @angular/cli? O problema parece estar na API, certo?

Você está utilizando qual Windows? Está rodando os comandos por qual terminal? Você está rodando os comandos em qual pasta?

Olhando um dos prints:

C:\WINDOWS\system32>npm install --unsafe-perm -g sqlite3

Parece que você tentou rodar o npm install na system32 e não dentro da API.

Espero ter ajudado.

Windows 10. Prompt de comando , na pasta api.

Fala Amanda, estranho, olhando os logs parece que o comando está sendo executado na pasta system32:

C:\WINDOWS\system32\package.json

Tenta reinstalar o Node.

Abraços.

solução!

Boa tarde Amanda

Estava tendo o mesmo problema que você e acredito que muito outros e não estava conseguir resolver, até que a pouco consegui, veja se resolve para você também.

Segue os passos que realizei: Primeiro o tentar rodar o comando:

npm install sqlite3

Ele acusava um erro de python, dizendo que não tinha o mesmo instalado para poder compilar a biblioteca do sqlite3.

Então o primeiro passo foi instalar essa biblioteca através do comando:

npm install -g node-gyp

Após executar esse comando e instalar o python, o erro mudou para o seguinte:

msvs_version not found

ou algo parecido, não guardei as mensagens apenas li e era isso pelo que me recordo.

Então segui os passos indicados nesse tutorial: https://stackoverflow.com/questions/57879150/how-can-i-solve-error-gypgyp-errerr-find-vsfind-vs-msvs-version-not-set-from-c

Siga a Alternativa 2, que consiste em instalar esse build tools do Visual Studio: https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools

E também instalar esse complemento do Visual Studio Community, https://i.stack.imgur.com/S3RgX.png (Desktop development with C++).

Eu já usava o Visual Studio Community, então adicionei o complemento, caso não use não sei se daria para instalar apenas as bibliotecas sem instalar o Visual Studio Community, eu tentei e não consegui, tive que instalar o complemento pelo Installer do Visual Studio Community.

Após a instalação eu rodei o seguinte script:

npm config set msvs_version 2019 --global

Depois rode o seguinte comando:

npm config get msvs_version (Ele tem que retornar 2019)

Depois de tudo isso feito basta rodar na pasta da api o:

npm install sqlite3

Ele será instalado com sucesso, e em seguida rodar a api com:

npm start

Espero que ajude, sei que pode ter ficado meio confuso mas os passos seguidos são basicamente esses e olhando nos sites que indiquei vai ficar mais fácil entender e chegar a solução.

A dica é sempre veja o primeiro erro que está dando na compilação ou instalação e vá resolvendo eles de cima pra baixo.

Att.

Danillo C Ventris

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