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

(MacOS chip M1) Problema na execução do comando "npm i" dentro da pasta api

daniel@MacBook-Air-de-Daniel api % pwd
/Users/daniel/Documents/workspace/alura/alura/angular/boas praticas/angular_formularios-main/api
daniel@MacBook-Air-de-Daniel api % npm i

> sqlite3@4.2.0 install /Users/daniel/Documents/workspace/alura/alura/angular/boas praticas/angular_formularios-main/api/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/v4.2.0/node-v83-darwin-x64.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for sqlite3@4.2.0 and node@14.17.0 (node-v83 ABI, unknown) (falling back to source compile with node-gyp) 
No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.

gyp: No Xcode or CLT version detected!
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:376:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Darwin 20.4.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/Users/daniel/Documents/workspace/alura/alura/angular/boas praticas/angular_formularios-main/api/node_modules/sqlite3/lib/binding/node-v83-darwin-x64/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/Users/daniel/Documents/workspace/alura/alura/angular/boas praticas/angular_formularios-main/api/node_modules/sqlite3/lib/binding/node-v83-darwin-x64" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v83"
gyp ERR! cwd /Users/daniel/Documents/workspace/alura/alura/angular/boas praticas/angular_formularios-main/api/node_modules/sqlite3
gyp ERR! node -v v14.17.0
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 '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/daniel/Documents/workspace/alura/alura/angular/boas praticas/angular_formularios-main/api/node_modules/sqlite3/lib/binding/node-v83-darwin-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/Users/daniel/Documents/workspace/alura/alura/angular/boas praticas/angular_formularios-main/api/node_modules/sqlite3/lib/binding/node-v83-darwin-x64 --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/daniel/Documents/workspace/alura/alura/angular/boas praticas/angular_formularios-main/api/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:376:20)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1055:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
node-pre-gyp ERR! System Darwin 20.4.0
node-pre-gyp ERR! command "/usr/local/bin/node" "/Users/daniel/Documents/workspace/alura/alura/angular/boas praticas/angular_formularios-main/api/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/daniel/Documents/workspace/alura/alura/angular/boas praticas/angular_formularios-main/api/node_modules/sqlite3
node-pre-gyp ERR! node -v v14.17.0
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! not ok 
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/daniel/Documents/workspace/alura/alura/angular/boas praticas/angular_formularios-main/api/node_modules/sqlite3/lib/binding/node-v83-darwin-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/Users/daniel/Documents/workspace/alura/alura/angular/boas praticas/angular_formularios-main/api/node_modules/sqlite3/lib/binding/node-v83-darwin-x64 --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
npm WARN gatitobook@1.0.0 No description
npm WARN gatitobook@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sqlite3@4.2.0 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the sqlite3@4.2.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/daniel/.npm/_logs/2021-05-23T19_26_42_209Z-debug.log
4 respostas
daniel@MacBook-Air-de-Daniel api % node -v
v14.17.0
daniel@MacBook-Air-de-Daniel api % npm -v
6.14.13
solução!

boa noite galera,

que estiver tendo o mesmo problema em questão,

a solução e atualizar a lib ( "sqlite3": "^4.1.0" ) para uma mais recente exemplo: ("sqlite3": "^5.0.2"),

abaixo esta o package.json que esta funcionado na minha maquina.

essa solução foi retirada do link https://cursos.alura.com.br/forum/topico-erro-ao-instalar-o-sqlite3-112927

{
  "name": "gatitobook",
  "version": "1.0.0",
  "description": "",
  "main": "server.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "node server.js"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "body-parser": "^1.18.2",
    "cors": "^2.8.4",
    "cryptiles": ">=4.1.2",
    "express": "^4.16.3",
    "jimp": "^0.2.28",
    "jsonwebtoken": "^8.2.0",
    "multer": "^1.3.0",
    "sqlite3": "^5.0.2",
    "uuid": "^3.2.1"
  }
}

Vlw Daniel, me ajudou aqui!

valeu pela dica Daniel !!