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

NPM START

O que pode estar ocorrendo? Como resolver?

PS D:\curso_vuejs_alura\vuejs_alura\api> npm install
npm WARN alurapic@1.0.0 No description
npm WARN alurapic@1.0.0 No repository field.

added 59 packages from 47 contributors and audited 59 packages in 1.486s
found 0 vulnerabilities

PS D:\curso_vuejs_alura\vuejs_alura\api> npm start    

> alurapic@1.0.0 start D:\curso_vuejs_alura\vuejs_alura\api
> node server.js

internal/modules/cjs/loader.js:883
  throw err;
  ^

Error: Cannot find module 'D:\curso_vuejs_alura\vuejs_alura\api\server.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
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\fb\AppData\Roaming\npm-cache\_logs\2020-11-28T14_14_07_209Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Users\\fb\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'start'
1 verbose cli ]
2 info using npm@6.14.9
3 info using node@v14.15.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle alurapic@1.0.0~prestart: alurapic@1.0.0
6 info lifecycle alurapic@1.0.0~start: alurapic@1.0.0
7 verbose lifecycle alurapic@1.0.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle alurapic@1.0.0~start: PATH: C:\Users\fb\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;D:\curso_vuejs_alura\vuejs_alura\api\node_modules\.bin;C:\Program Files\ImageMagick-7.0.10-Q16-HDRI;C:\MinGW\bin;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\Java\jdk1.8.0_261\bin;C:\Windows\System32;C:\xampp\php;C:\Program Files\Git\bin;C:\Program Files\Git\cmd;C:\Program Files\nodejs;C:\Program Files\nodejs\;C:\composer19;C:\MinGW\bin;C:\Program Files\liquibase;C:\Users\fb\AppData\Roaming\npm;C:\Users\fb\AppData\Roaming\Composer\vendor\bin;C:\Program Files (x86)\EaseUS\Todo Backup\bin\x64\
9 verbose lifecycle alurapic@1.0.0~start: CWD: D:\curso_vuejs_alura\vuejs_alura\api
10 silly lifecycle alurapic@1.0.0~start: Args: [ '/d /s /c', 'node server.js' ]
11 silly lifecycle alurapic@1.0.0~start: Returned: code: 1  signal: null
12 info lifecycle alurapic@1.0.0~start: Failed to exec start script
13 verbose stack Error: alurapic@1.0.0 start: `node server.js`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\Users\fb\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:315:20)
13 verbose stack     at ChildProcess.<anonymous> (C:\Users\fb\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:315:20)
13 verbose stack     at maybeClose (internal/child_process.js:1048:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
14 verbose pkgid alurapic@1.0.0
15 verbose cwd D:\curso_vuejs_alura\vuejs_alura\api
16 verbose Windows_NT 10.0.18363
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\fb\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v14.15.0
19 verbose npm  v6.14.9
20 error code ELIFECYCLE
21 error errno 1
22 error alurapic@1.0.0 start: `node server.js`
22 error Exit status 1
23 error Failed at the alurapic@1.0.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
2 respostas
solução!

Oi, Fabiana, tudo bem?

Dentro da sua pasta api tem o arquivo server.js? Testei aqui e consegui subir a pasta api sem problemas.

Olá. Obrigada, a pasta api/server estava dentro de outra pasta api (api/api/server.js), por isso nao estava funcionando.