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

Não consegui rodar npm install/start

Não consegui rodar os comandos npm install e start. Minhas versões do node e react são as mais recentes. Isso pode ter dado problema? Como rodar na versão atual?

7 respostas

Oi Anderson, pode enviar mais detalhes? Print ou mensagens de erro, assim conseguimos entender melhor o que pode ter ocorrido.

PS C:\Users\anderson.vieira\Downloads\instalura-api> npm install
npm ERR! code 1
npm ERR! path C:\Users\anderson.vieira\Downloads\instalura-api\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:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\anderson.vieira\Downloads\instalura-api\node_modules\sqlite3\lib\binding\napi-v6-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=C:\Users\anderson.vieira\Downloads\instalura-api\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)
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using node-pre-gyp@0.11.0
npm ERR! node-pre-gyp info using node@15.8.0 | win32 | x64
npm ERR! node-pre-gyp WARN Using request for node-pre-gyp https download
npm ERR! node-pre-gyp info check checked for "C:\Users\anderson.vieira\Downloads\instalura-api\node_modules\sqlite3\lib\binding\napi-v6-win32-x64\node_sqlite3.node" (not found)
npm ERR! node-pre-gyp http GET https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.1/napi-v6-win32-x64.tar.gz
npm ERR! node-pre-gyp WARN Pre-built binaries not installable for sqlite3@5.0.1 and node@15.8.0 (node-v88 ABI, unknown) (falling back to source compile with node-gyp)
npm ERR! node-pre-gyp WARN Hit error connect ETIMEDOUT 52.216.142.100:443
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@15.8.0 | 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@7.1.2
npm ERR! gyp info using node@15.8.0 | win32 | x64
npm ERR! gyp info find Python using Python version 2.7.18 found at "C:\Python27\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:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
npm ERR! gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:16
npm ERR! gyp ERR! stack     at VisualStudioFinder.findVisualStudio2013 (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:351:14)
npm ERR! gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:70:14
npm ERR! gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:372:16
npm ERR! gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7
npm ERR! gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
npm ERR! gyp ERR! stack     at ChildProcess.exithandler (node:child_process:334:5)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:378:20)
npm ERR! gyp ERR! stack     at maybeClose (node:internal/child_process:1067:16)
npm ERR! gyp ERR! System Windows_NT 10.0.19042
npm ERR! 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\\anderson.vieira\\Downloads\\instalura-api\\node_modules\\sqlite3\\lib\\binding\\napi-v6-win32-x64\\node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=C:\\Users\\anderson.vieira\\Downloads\\instalura-api\\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"
npm ERR! gyp ERR! cwd C:\Users\anderson.vieira\Downloads\instalura-api\node_modules\sqlite3
npm ERR! gyp ERR! node -v v15.8.0
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok
npm ERR! node-pre-gyp ERR! build error
npm ERR! 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\anderson.vieira\Downloads\instalura-api\node_modules\sqlite3\lib\binding\napi-v6-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=C:\Users\anderson.vieira\Downloads\instalura-api\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)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\Users\anderson.vieira\Downloads\instalura-api\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:378:20)
npm ERR! node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1067:16)
npm ERR! node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
npm ERR! node-pre-gyp ERR! System Windows_NT 10.0.19042
npm ERR! node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\anderson.vieira\\Downloads\\instalura-api\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
npm ERR! node-pre-gyp ERR! cwd C:\Users\anderson.vieira\Downloads\instalura-api\node_modules\sqlite3
npm ERR! node-pre-gyp ERR! node -v v15.8.0
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v0.11.0
npm ERR! node-pre-gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\anderson.vieira\AppData\Local\npm-cache\_logs\2021-02-09T14_06_18_871Z-debug.log

Isso pra npm install... agora vou mandar o npm start:

PS C:\Users\anderson.vieira\Downloads\instalura-api> npm start

> instalura-api@1.0.0 start
> node server.js

node:internal/modules/cjs/loader:928
  throw err;
  ^

Error: Cannot find module 'express'
Require stack:
- C:\Users\anderson.vieira\Downloads\instalura-api\config\express.js
- C:\Users\anderson.vieira\Downloads\instalura-api\server.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:925:15)
    at Function.Module._load (node:internal/modules/cjs/loader:769:27)
    at Module.require (node:internal/modules/cjs/loader:997:19)
    at require (node:internal/modules/cjs/helpers:92:18)
    at Object.<anonymous> (C:\Users\anderson.vieira\Downloads\instalura-api\config\express.js:21:17)
    at Module._compile (node:internal/modules/cjs/loader:1108:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
    at Module.load (node:internal/modules/cjs/loader:973:32)
    at Function.Module._load (node:internal/modules/cjs/loader:813:14)
    at Module.require (node:internal/modules/cjs/loader:997:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\Users\\anderson.vieira\\Downloads\\instalura-api\\config\\express.js',
    'C:\\Users\\anderson.vieira\\Downloads\\instalura-api\\server.js'
  ]
}
npm ERR! code 1
npm ERR! path C:\Users\anderson.vieira\Downloads\instalura-api
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node server.js

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\anderson.vieira\AppData\Local\npm-cache\_logs\2021-02-09T14_28_20_289Z-debug.log
solução!

O problema era o proxy!