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

Erro no npm start do client

Depois de instalar a parte do jquery, começou a dar o erro abaixo (Mac OS):

MBP-de-Orlando:client orlando$ npm start

> client@1.0.0 start /Users/orlando/Dropbox/Estudos/Angular2/alurapic-parte2/client
> npm run tsc:w


> client@1.0.0 tsc:w /Users/orlando/Dropbox/Estudos/Angular2/alurapic-parte2/client
> tsc -w

module.js:471
    throw err;
    ^

Error: Cannot find module '../lib/tsc.js'
    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> (/Users/orlando/Dropbox/Estudos/Angular2/alurapic-parte2/client/node_modules/.bin/tsc:2:1)
    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! Darwin 16.1.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "tsc:w"
npm ERR! node v6.9.1
npm ERR! npm  v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! client@1.0.0 tsc:w: `tsc -w`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the client@1.0.0 tsc:w script 'tsc -w'.
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 client package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     tsc -w
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs client
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls client
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/orlando/Dropbox/Estudos/Angular2/alurapic-parte2/client/npm-debug.log

npm ERR! Darwin 16.1.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v6.9.1
npm ERR! npm  v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! client@1.0.0 start: `npm run tsc:w`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the client@1.0.0 start script 'npm run tsc:w'.
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 client package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run tsc:w
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs client
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls client
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/orlando/Dropbox/Estudos/Angular2/alurapic-parte2/client/npm-debug.log
MBP-de-Orlando:client orlando$ tsc -v
Version 2.0.6
MBP-de-Orlando:client orlando$ npm -v
3.10.8
MBP-de-Orlando:client orlando$ node -v
v6.9.1
7 respostas
solução!

Cruzes! :)

Com certeza isso não era para acontecer. Contudo, você pode tentar a solução mega hiper ultra blaster.

Apague a pasta alurapic/client/node_modules e vá para dentro da mesma pasta no terminal e execute o comando:

npm install

Orlando, em teoria, a instalação do jQuery não tem relação com o processo de compilação do TypeScript. Mas eu já vi cada coisa no mundo da programação que vou investigar.

Aguardo seu retorno para saber se esta tudo ok depois de ter baixado todas as dependências novamente.

Você não instalou nenhuma dependência global não, instalou? Ou será que tentou instalar o Typescript global?

Aguardo seu retorno.

Eu acho q instalei o typescript global sim, se não me engano em alguma parte do curso ensina isso...

Mas de qualquer forma, o seu procedimento indicado deu certo. ;)

Opa! Eu não ensino a instalar o TypeScript global não. :) Na dúvida faça assim: npm uninstall typescript, mas fora da pasta do projeto.

Estou pesquisando na internet e alguns usuários tinham problemas como esse lá em 2015....era um conflito no linux do binário ser nodejs ao invés de node.

O binário do seu node é node ou nodejs?

Opa show! Não sei o que houve, mas eu to esperto que esse erro ocorrer quando falta uma dependência do TypeScript e para garantir a gente baixou tudo novamente.

Agora é continuar até o final do curso. Sucesso Orlando!

Bom, por desencargo, desinstalei o typescript global, como você indicou, e refiz o npm install. Já estava funcionando sem o uninstall do typescript global, mas, por desencargo já desinstalei e refiz o processo. Tudo funcionando.

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software