não consigo fazer o moment funcionar no navegador!
Microsoft Windows [versão 10.0.19041.804]
(c) 2020 Microsoft Corporation. Todos os direitos reservados.
C:\Users\geova\OneDrive\Área de Trabalho\projeto>npm install -- save-dev nodemon
> nodemon@2.0.7 postinstall C:\Users\geova\OneDrive\Área de Trabalho\projeto\node_modules\nodemon
> node bin/postinstall || exit 0
Love nodemon? You can now support the project via the open collective:
> https://opencollective.com/nodemon/donate
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.1 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN projeto-nodejs-rest@1.0.0 No description
+ save-dev@0.0.1-security
+ nodemon@2.0.7
added 118 packages from 53 contributors and audited 170 packages in 18.29s
C:\Users\geova\OneDrive\Área de Trabalho\projeto>cd node index.js
O sistema não pode encontrar o caminho especificado.
C:\Users\geova\OneDrive\Área de Trabalho\projeto>
C:\Users\geova\OneDrive\Área de Trabalho\projeto>npm start
> projeto-nodejs-rest@1.0.0 start C:\Users\geova\OneDrive\Área de Trabalho\projeto
> node index.js
events.js:292
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE: address already in use :::8000
at Server.setupListenHandle [as _listen2] (net.js:1318:16)
at listenInCluster (net.js:1366:12)
at Server.listen (net.js:1452:7)
at Function.listen (C:\Users\geova\OneDrive\Área de Trabalho\projeto\node_modules\express\lib\application.js:618:24)
at Object.<anonymous> (C:\Users\geova\OneDrive\Área de Trabalho\projeto\index.js:5:5)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
Emitted 'error' event on Server instance at:
at emitErrorNT (net.js:1345:8)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
code: 'EADDRINUSE',
errno: -4091,
syscall: 'listen',
address: '::',
port: 8000
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! projeto-nodejs-rest@1.0.0 start: `node index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the projeto-nodejs-rest@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\geova\AppData\Roaming\npm-cache\_logs\2021-03-02T16_36_00_245Z-debug.log
C:\Users\geova\OneDrive\Área de Trabalho\projeto>
C:\Users\geova\OneDrive\Área de Trabalho\projeto>
C:\Users\geova\OneDrive\Área de Trabalho\projeto>npm start
> projeto-nodejs-rest@1.0.0 start C:\Users\geova\OneDrive\Área de Trabalho\projeto
> node index.js
events.js:292
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE: address already in use :::3000
at Server.setupListenHandle [as _listen2] (net.js:1318:16)
at listenInCluster (net.js:1366:12)
at Server.listen (net.js:1452:7)
at Function.listen (C:\Users\geova\OneDrive\Área de Trabalho\projeto\node_modules\express\lib\application.js:618:24)
at Object.<anonymous> (C:\Users\geova\OneDrive\Área de Trabalho\projeto\index.js:5:5)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
Emitted 'error' event on Server instance at:
at emitErrorNT (net.js:1345:8)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
code: 'EADDRINUSE',
errno: -4091,
syscall: 'listen',
address: '::',
port: 3000
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! projeto-nodejs-rest@1.0.0 start: `node index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the projeto-nodejs-rest@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\geova\AppData\Roaming\npm-cache\_logs\2021-03-02T16_37_06_413Z-debug.log
C:\Users\geova\OneDrive\Área de Trabalho\projeto>npm install mondemon
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/mondemon - Not found
npm ERR! 404
npm ERR! 404 'mondemon@latest' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
C:\Users\geova\OneDrive\Área de Trabalho\projeto>node index.js
(node:50908) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
C:\Users\geova\OneDrive\Área de Trabalho\projeto\index.js:9
import moment from 'moment';
^^^^^^
SyntaxError: Cannot use import statement outside a module
at wrapSafe (internal/modules/cjs/loader.js:979:16)
at Module._compile (internal/modules/cjs/loader.js:1027:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47
C:\Users\geova\OneDrive\Área de Trabalho\projeto>