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

Erro ao executar (npm start)

Fiz tudo como manda no tutorial mas quando dei o executar apareceu o seguinte erro:

c:\Users\marcos.cunha.TQI\Downloads\01-alurapic\alurapic>npm start

> alurapic@1.0.0 start c:\Users\marcos.cunha.TQI\Downloads\01-alurapic\alurapic
> node server.js

module.js:471
    throw err;
    ^

Error: Cannot find module 'express'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (c:\Users\marcos.cunha.TQI\Downloads\01-alurapic\alurapic\config\express.js:1:77)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)

npm ERR! Windows_NT 10.0.10240
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v6.9.1
npm ERR! npm  v3.10.8
npm ERR! code ELIFECYCLE
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 'node server.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the alurapic package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node server.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs alurapic
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls alurapic
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! Please include the following file with any support request:
npm ERR!     c:\Users\marcos.cunha.TQI\Downloads\01-alurapic\alurapic\npm-debug.log
6 respostas

Olá, Marcos! Tudo bem? =)

Você lembrou de fazer o comando npm install? Ele é o responsável por baixar as dependências... Depois dele você pode rodar o npm start. =)

Fábio

Ele não conseguiu encontrar o express. Confirma se dentro da tua pasta alurapic tem uma pasta node_modules e se dentro dela tem uma chamda express.Caso você não tenha nenhuma dessas pastas vá de novo na pasta do alurapic e executa o npm install porque algo de errado aconteceu na hora de executar esse comando.Se você tiver elas tenta apagar a pasta node_modules e executar o npm install para tentar baixar tudo de novo corretamente.OBS: Se você estiver com um pouco de preguiça, pode abreviar e usar o comando npm i que é um atalho para o install.

Marcos, você não pode executar o npm start antes de executar o npm install. É por isso que ele esta dizendo que não encontra o módulo express, porque ele não foi baixado pelo comando npm install.

Faça o procedimento novamente e poste o resultado.

Eu tinha executado o comando instal, como podem ver abaixo. mas quando rodei novamente o comando ele funcionou.

Muito Obrigado pela ajuda pessoal!

c:\Users\marcos.cunha.TQI\Downloads\01-alurapic\alurapic>npm instal

Usage: npm <command>

where <command> is one of:
    access, adduser, bin, bugs, c, cache, completion, config,
    ddp, dedupe, deprecate, dist-tag, docs, edit, explore, get,
    help, help-search, i, init, install, install-test, it, link,
    list, ln, login, logout, ls, outdated, owner, pack, ping,
    prefix, prune, publish, rb, rebuild, repo, restart, root,
    run, run-script, s, se, search, set, shrinkwrap, star,
    stars, start, stop, t, tag, team, test, tst, un, uninstall,
    unpublish, unstar, up, update, v, version, view, whoami

npm <cmd> -h     quick help on <cmd>
npm -l           display full usage info
npm help <term>  search for help on <term>
npm help npm     involved overview

Specify configs in the ini-formatted file:
    C:\Users\marcos.cunha.TQI\.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config

npm@3.10.8 C:\Program Files\nodejs\node_modules\npm

c:\Users\marcos.cunha.TQI\Downloads\01-alurapic\alurapic>npm start

> alurapic@1.0.0 start c:\Users\marcos.cunha.TQI\Downloads\01-alurapic\alurapic
> node server.js

module.js:471
    throw err;
    ^

Error: Cannot find module 'express'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (c:\Users\marcos.cunha.TQI\Downloads\01-alurapic\alurapic\config\express.js:1:77)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)

npm ERR! Windows_NT 10.0.10240
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v6.9.1
npm ERR! npm  v3.10.8
npm ERR! code ELIFECYCLE
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 'node server.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the alurapic package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node server.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs alurapic
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls alurapic
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! Please include the following file with any support request:
npm ERR!     c:\Users\marcos.cunha.TQI\Downloads\01-alurapic\alurapic\npm-debug.log

c:\Users\marcos.cunha.TQI\Downloads\01-alurapic\alurapic>
solução!

Você escreveu install errado no exemplo dado. Quando rodou novamente deve ter escrito certo. Acontece.

alurapic@1.0.0 start C:\Users\Inc\Google Drive\Estudo\Cursos Alura\Angular 1\alurapic node server.js

module.js:471 throw err; ^

Error: Cannot find module 'ms' at Function.Module._resolveFilename (module.js:469:15) at Function.Module._load (module.js:417:25) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at Object. (C:\Users\Inc\Google Drive\Estudo\Cursos Alura\Angular 1\alurapic\node_modules\debug\debug.js:14:20) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3)

npm ERR! Windows_NT 10.0.14393 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "start" npm ERR! node v6.9.1 npm ERR! npm v3.10.8 npm ERR! code ELIFECYCLE 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 'node server.js'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the alurapic package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node server.js npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs alurapic npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls alurapic npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! C:\Users\Inc\Google Drive\Estudo\Cursos Alura\Angular 1\alurapic\npm-debug.log