Bom, estava com o erro no npm install
e apliquei o npm install --unsafe-perm -g sqlite3
como cita no curso e apareceu a seguinte mensagem:
npm WARN deprecated node-pre-gyp@0.11.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap. npm WARN deprecated har-validator@5.1.5: this library is no longer supported npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
sqlite3@5.0.2 install C:\Users\Alan\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 [sqlite3] Success: "C:\Users\Alan\AppData\Roaming\npm\node_modules\sqlite3\lib\binding\napi-v3-win32-x64\node_sqlite3.node" is installed via remote
- sqlite3@5.0.2 updated 1 package in 6.546s
Depois, quando coloco o npm start
na parta da API, aparece o seguinte erro:
alurapic@1.0.0 start D:\Sublime Text 3\Projetos\7- Angular\api node server.js
internal/modules/cjs/loader.js:892 throw err; ^
Error: Cannot find module 'sqlite3' Require stack:
- D:\Sublime Text 3\Projetos\7- Angular\api\config\database.js
- D:\Sublime Text 3\Projetos\7- Angular\api\config\express.js
- D:\Sublime Text 3\Projetos\7- Angular\api\server.js
at Function.Module.resolveFilename (internal/modules/cjs/loader.js:889:15)
at Function.Module.load (internal/modules/cjs/loader.js:745:27)
at Module.require (internal/modules/cjs/loader.js:961:19)
at require (internal/modules/cjs/helpers.js:92:18)
at Object. (D:\Sublime Text 3\Projetos\7- Angular\api\config\database.js:1:17)
at Module.compile (internal/modules/cjs/loader.js:1072:14)
at Object.Module.extensions..js (internal/modules/cjs/loader.js:1101:10)
at Module.load (internal/modules/cjs/loader.js:937:32)
at Function.Module.load (internal/modules/cjs/loader.js:778:12)
at Module.require (internal/modules/cjs/loader.js:961:19) {
code: 'MODULENOT_FOUND',
requireStack: [
'D:\Sublime Text 3\Projetos\7- Angular\api\config\database.js',
'D:\Sublime Text 3\Projetos\7- Angular\api\config\express.js',
'D:\Sublime Text 3\Projetos\7- Angular\api\server.js'
]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! alurapic@1.0.0 start:
node server.js
npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the alurapic@1.0.0 start 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! C:\Users\Alan\AppData\Roaming\npm-cache_logs\2021-09-09T12_12_12_796Z-debug.log
Alguém consegue me ajudar?