2
respostas

Erro ao subir projeto Ionic 2 aula 1

Olá. Executei os passos como diz no curso na aula 1. Biazei o projeto, acessei a pasta no diretório, porém algumas erros ocorreram ao fazer a instalção das dependências na pasta 'AluraCar' e também houve erro ao tentar subir a aplicação. O que posso fazer para corrigir este problema?

Há erro em diversas dependências do ionic. A versão do node js que utilizo é a mais recente (que não seja a de teste, a partir da versão 6, como manda o figurino). Uso Windows 10.


C:\Users\Paulo\Documents\aluraapps\aluraCar>npm install

> node-sass@3.10.1 install C:\Users\Paulo\Documents\aluraapps\aluraCar\node_modules\node-sass
> node scripts/install.js

Start downloading binary at https://github.com/sass/node-sass/releases/download/v3.10.1/win32-x64-57_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v3.10.1/win32-x64-57_binding.node": ode:

HTTP error 404 Not Found

Hint: If github.com is not accessible in your location
      try setting a proxy via HTTP_PROXY, e.g.

      export HTTP_PROXY=http://example.com:1234

or configure npm proxy via

      npm config set proxy http://example.com:8080

> node-sass@3.10.1 postinstall C:\Users\Paulo\Documents\aluraapps\aluraCar\node_modules\node-sass
> node scripts/build.js

Building: C:\Program Files\nodejs\node.exe C:\Users\Paulo\Documents\aluraapps\aluraCar\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
gyp verb cli   'C:\\Users\\Paulo\\Documents\\aluraapps\\aluraCar\\node_modules\\node-gyp\\bin\\node-gyp.js',
gyp verb cli   'rebuild',
gyp verb cli   '--verbose',
gyp verb cli   '--libsass_ext=',
gyp verb cli   '--libsass_cflags=',
gyp verb cli   '--libsass_ldflags=',
gyp verb cli   '--libsass_library=' ]
gyp info using node-gyp@3.6.2
gyp info using node@8.2.1 | win32 | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed     at getNotFoundError (C:\Users\Paulo\Documents\aluraapps\aluraCar\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\Users\Paulo\Documents\aluraapps\aluraCar\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\Users\Paulo\Documents\aluraapps\aluraCar\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\Users\Paulo\Documents\aluraapps\aluraCar\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\Users\Paulo\Documents\aluraapps\aluraCar\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\Users\Paulo\Documents\aluraapps\aluraCar\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:152:21)
gyp verb `which` failed  python2 { Error: not found: python2
gyp verb `which` failed     at getNotFoundError (C:\Users\Paulo\Documents\aluraapps\aluraCar\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\Users\Paulo\Documents\aluraapps\aluraCar\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\Users\Paulo\Documents\aluraapps\aluraCar\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\Users\Paulo\Documents\aluraapps\aluraCar\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\Users\Paulo\Documents\aluraapps\aluraCar\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\Users\Paulo\Documents\aluraapps\aluraCar\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:152:21)
gyp verb `which` failed   stack: 'Error: not found: python2\n    at getNotFoundError (C:\\Users\\Paulo\\Documents\\aluraapps\\aluraCar\\node_modules\\which\\which.js:13:12)\n    at F (C:\\Users\\Paulo\\Documents\\aluraapps\\aluraCar\\node_modules\\which\\which.js:68:19)\n    at E (C:\\Users\\Paulo\\Documents\\aluraapps\\aluraCar\\node_modules\\which\\which.js:80:29)\n    at C:\\Users\\Paulo\\Documents\\aluraapps\\aluraCar\\node_modules\\which\\which.js:89:16\n    at C:\\Users\\Paulo\\Documents\\aluraapps\\aluraCar\\node_modules\\isexe\\index.js:42:5\n    at C:\\Users\\Paulo\\Documents\\aluraapps\\aluraCar\\node_modules\\isexe\\windows.js:36:5\n    at FSReqWrap.oncomplete (fs.js:152:21)',
gyp verb `which` failed   code: 'ENOENT' }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` failed Error: not found: python
gyp verb `which` failed     at getNotFoundError (C:\Users\Paulo\Documents\aluraapps\aluraCar\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\Users\Paulo\Documents\aluraapps\aluraCar\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\Users\Paulo\Documents\aluraapps\aluraCar\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\Users\Paulo\Documents\aluraapps\aluraCar\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\Users\Paulo\Documents\aluraapps\aluraCar\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\Users\Paulo\Documents\aluraapps\aluraCar\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:152:21)
gyp verb `which` failed  python { Error: not found: python
gyp verb `which` failed     at getNotFoundError (C:\Users\Paulo\Documents\aluraapps\aluraCar\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\Users\Paulo\Documents\aluraapps\aluraCar\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\Users\Paulo\Documents\aluraapps\aluraCar\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\Users\Paulo\Documents\aluraapps\aluraCar\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\Users\Paulo\Documents\aluraapps\aluraCar\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\Users\Paulo\Documents\aluraapps\aluraCar\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:152:21)
gyp verb `which` failed   stack: 'Error: not found: python\n    at getNotFoundError (C:\\Users\\Paulo\\Documents\\aluraapps\\aluraCar\\node_modules\\which\\which.js:13:12)\n    at F (C:\\Users\\Paulo\\Documents\\aluraapps\\aluraCar\\node_modules\\which\\which.js:68:19)\n    at E (C:\\Users\\Paulo\\Documents\\aluraapps\\aluraCar\\node_modules\\which\\which.js:80:29)\n    at C:\\Users\\Paulo\\Documents\\aluraapps\\aluraCar\\node_modules\\which\\which.js:89:16\n    at C:\\Users\\Paulo\\Documents\\aluraapps\\aluraCar\\node_modules\\isexe\\index.js:42:5\n    at C:\\Users\\Paulo\\Documents\\aluraapps\\aluraCar\\node_modules\\isexe\\windows.js:36:5\n    at FSReqWrap.oncomplete (fs.js:152:21)',
gyp verb `which` failed   code: 'ENOENT' }
gyp verb could not find "python". checking python launcher
gyp verb could not find "python". guessing location
gyp verb ensuring that file exists: C:\Python27\python.exe
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (C:\Users\Paulo\Documents\aluraapps\aluraCar\node_modules\node-gyp\lib\configure.js:483:19)
gyp ERR! stack     at PythonFinder.<anonymous> (C:\Users\Paulo\Documents\aluraapps\aluraCar\node_modules\node-gyp\lib\configure.js:508:16)
gyp ERR! stack     at C:\Users\Paulo\Documents\aluraapps\aluraCar\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Windows_NT 10.0.10586
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Paulo\\Documents\\aluraapps\\aluraCar\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Users\Paulo\Documents\aluraapps\aluraCar\node_modules\node-sass
gyp ERR! node -v v8.2.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed
npm WARN Error: EPERM: operation not permitted, scandir 'C:\Users\Paulo\Documents\aluraapps\aluraCar\node_modules\getpass\node_modules'
npm WARN  { Error: EPERM: operation not permitted, scandir 'C:\Users\Paulo\Documents\aluraapps\aluraCar\node_modules\getpass\node_modules'
npm WARN   stack: 'Error: EPERM: operation not permitted, scandir \'C:\\Users\\Paulo\\Documents\\aluraapps\\aluraCar\\node_modules\\getpass\\node_modules\'',
npm WARN   errno: -4048,
npm WARN   code: 'EPERM',
npm WARN   syscall: 'scandir',
npm WARN   path: 'C:\\Users\\Paulo\\Documents\\aluraapps\\aluraCar\\node_modules\\getpass\\node_modules' }
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@3.10.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@3.10.1 postinstall 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\Paulo\AppData\Roaming\npm-cache\_logs\2017-08-17T01_23_19_446Z-debug.log

C:\Users\Paulo\Documents\aluraapps\aluraCar> ionic serve --lab
******************************************************
 Dependency warning - for the CLI to run correctly,
 it is highly recommended to install/upgrade the following:

 Please install your Cordova CLI to version  >=4.2.0 `npm install -g cordova`

******************************************************

> ionic-hello-world@ ionic:serve C:\Users\Paulo\Documents\aluraapps\aluraCar
> ionic-app-scripts serve "--v2" "--lab" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"

module.js:487
    throw err;
    ^

Error: Cannot find module 'C:\Users\Paulo\Documents\aluraapps\aluraCar\node_modules\@ionic\app-scripts\bin\ionic-app-scripts.js'
    at Function.Module._resolveFilename (module.js:485:15)
    at Function.Module._load (module.js:437:25)
    at Function.Module.runMain (module.js:605:10)
    at startup (bootstrap_node.js:158:16)
    at bootstrap_node.js:575:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ionic-hello-world@ ionic:serve: `ionic-app-scripts serve "--v2" "--lab" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ionic-hello-world@ ionic:serve 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\Paulo\AppData\Roaming\npm-cache\_logs\2017-08-17T01_24_12_356Z-debug.log
There was an error serving your Ionic application: There was an error with the spawned command: serve

C:\Users\Paulo\Documents\aluraapps\aluraCar>
2 respostas

Você esta por de trás de um proxy em sua rede. Esse proxy esta o impedindo de acessar os repositórios do npm e do git pelo comando npm install. Você esta executando o comando dentro de uma rede de empresa?

Independente se é em casa ou na empresa, você precisa saber o endereço do seu proxy e ensinar o npm para lidar com isso (estou pressupondo que você esta usando Node.js 6 ou 8.0, ok?).

Há aqui uma instrução de como configurar o npm atrás de um proxy:

https://jjasonclark.com/how-to-setup-node-behind-web-proxy/

Veja as instruções no final. Elas devem receber o valor do seu proxy. Provavelmente se você não resolver terá problema em outros cursos que usam npm.

Obrigado Flávio por responder. Estou utilizando o computador em casa. Até onde sei nunca precisei realizar configuração de Proxy. Neste caso eu tenho que contatar a minha operadora (Vivo) para oferecer as informações de proxy em uma rede doméstica?

Irei tentar em outro computador na mesma rede doméstica e realizarei o teste.

Sim, estou utilizando o node versão 6. Irei tentar com a versão 8 e/ou em outro computador na rede doméstica.

O link tem informações úteis para montar este ambiente na empresa onde eu trabalho, onde de fato há proxy. Irei realizar novos testes e postarei informações aqui. Muito obrigado!