10
respostas

Erro na instalação do ionic

Eu tentei instalar o Ionic através do comando "npm install -g ionic@1" que está no exercício, porém eu sempre recebo a seguinte mensagem:

C:\Users\allan\AppData\Roaming\npm\ionic -> C:\Users\allan\AppData\Roaming\npm\node_modules\ionic\bin\ionic

> node-sass@3.8.0 install C:\Users\allan\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass
> node scripts/install.js

Cannot download "https://github.com/sass/node-sass/releases/download/v3.8.0/win32-x64-57_binding.node":

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.8.0 postinstall C:\Users\allan\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass
> node scripts/build.js

Building: C:\Program Files\nodejs\node.exe C:\Users\allan\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\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\\allan\\AppData\\Roaming\\npm\\node_modules\\ionic\\node_modules\\ionic-app-lib\\node_modules\\node-sass\\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.3.1
gyp info using node@8.0.0 | 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\allan\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\node_modules\node-gyp\node_modules\which\which.js:14:12)
gyp verb `which` failed     at F (C:\Users\allan\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\node_modules\node-gyp\node_modules\which\which.js:69:19)
gyp verb `which` failed     at E (C:\Users\allan\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\node_modules\node-gyp\node_modules\which\which.js:81:29)
gyp verb `which` failed     at C:\Users\allan\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\node_modules\node-gyp\node_modules\which\which.js:90:16
gyp verb `which` failed     at C:\Users\allan\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\node_modules\node-gyp\node_modules\which\node_modules\isexe\index.js:44:5
gyp verb `which` failed     at C:\Users\allan\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\node_modules\node-gyp\node_modules\which\node_modules\isexe\windows.js:29: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\allan\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\node_modules\node-gyp\node_modules\which\which.js:14:12)
gyp verb `which` failed     at F (C:\Users\allan\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\node_modules\node-gyp\node_modules\which\which.js:69:19)
gyp verb `which` failed     at E (C:\Users\allan\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\node_modules\node-gyp\node_modules\which\which.js:81:29)
gyp verb `which` failed     at C:\Users\allan\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\node_modules\node-gyp\node_modules\which\which.js:90:16
gyp verb `which` failed     at C:\Users\allan\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\node_modules\node-gyp\node_modules\which\node_modules\isexe\index.js:44:5
gyp verb `which` failed     at C:\Users\allan\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\node_modules\node-gyp\node_modules\which\node_modules\isexe\windows.js:29:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:152:21) 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\allan\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\node_modules\node-gyp\node_modules\which\which.js:14:12)
gyp verb `which` failed     at F (C:\Users\allan\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\node_modules\node-gyp\node_modules\which\which.js:69:19)
gyp verb `which` failed     at E (C:\Users\allan\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\node_modules\node-gyp\node_modules\which\which.js:81:29)
gyp verb `which` failed     at C:\Users\allan\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\node_modules\node-gyp\node_modules\which\which.js:90:16
gyp verb `which` failed     at C:\Users\allan\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\node_modules\node-gyp\node_modules\which\node_modules\isexe\index.js:44:5
gyp verb `which` failed     at C:\Users\allan\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\node_modules\node-gyp\node_modules\which\node_modules\isexe\windows.js:29: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\allan\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\node_modules\node-gyp\node_modules\which\which.js:14:12)
gyp verb `which` failed     at F (C:\Users\allan\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\node_modules\node-gyp\node_modules\which\which.js:69:19)
gyp verb `which` failed     at E (C:\Users\allan\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\node_modules\node-gyp\node_modules\which\which.js:81:29)
gyp verb `which` failed     at C:\Users\allan\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\node_modules\node-gyp\node_modules\which\which.js:90:16
gyp verb `which` failed     at C:\Users\allan\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\node_modules\node-gyp\node_modules\which\node_modules\isexe\index.js:44:5
gyp verb `which` failed     at C:\Users\allan\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\node_modules\node-gyp\node_modules\which\node_modules\isexe\windows.js:29:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:152:21) code: 'ENOENT' }
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 failNoPython (C:\Users\allan\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\node_modules\node-gyp\lib\configure.js:401:14)
gyp ERR! stack     at C:\Users\allan\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass\node_modules\node-gyp\lib\configure.js:356:11
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Windows_NT 10.0.15063
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\allan\\AppData\\Roaming\\npm\\node_modules\\ionic\\node_modules\\ionic-app-lib\\node_modules\\node-sass\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Users\allan\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\node-sass
gyp ERR! node -v v8.0.0
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
Build failed
npm ERR! Cannot read property 'type' of undefined

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\allan\AppData\Roaming\npm-cache\_logs\2017-06-09T20_33_14_545Z-debug.log

E quando eu executo o "ionic resources", aparece a seguinte mensagem:

module.js:487
    throw err;
    ^

Error: Cannot find module 'C:\Users\allan\AppData\Roaming\npm\node_modules\ionic\bin\ionic'
    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

Alguém sabe alguma maneira de resolver este problema?

10 respostas

Eu já tentei também instalar o Ionic 3, porém eu tentava o comando "ionic cordova resources android", como está na documentação do Ionic 3, e aparecia uma mensagem dizendo que a pasta garconapp não era uma pasta de um aplicativo

estou com o mesmo problema e ainda não obtive resposta!!!!

Tentei o "npm install -g ionic@1.6" e continua dando erro, porém o erro mudou e agora aparecem as seguintes mensagens:

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: xtend@4.0.0 (node_modules\ionic\node_modules\ionic-app-lib\node_modules\vinyl-fs\node_modules\through2\node_modules\xtend):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: EEXIST: file already exists, mkdir 'C:\Users\allan\AppData\Roaming\npm\node_modules\.staging\xtend-bd5977ae'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: File exists: C:\Users\allan\AppData\Roaming\npm\node_modules\.staging\xtend-bd5977ae
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: npmlog@0.1.1 (node_modules\ionic\node_modules\npm\node_modules\npmlog):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, utime 'C:\Users\allan\AppData\Roaming\npm\node_modules\.staging\npmlog-995d08b6\example.js'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: promzard@0.2.2 (node_modules\ionic\node_modules\npm\node_modules\init-package-json\node_modules\promzard):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, utime 'C:\Users\allan\AppData\Roaming\npm\node_modules\.staging\promzard-92e6b5a6\LICENSE'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: github-url-from-username-repo@1.0.2 (node_modules\ionic\node_modules\npm\node_modules\github-url-from-username-repo):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, utime 'C:\Users\allan\AppData\Roaming\npm\node_modules\.staging\github-url-from-username-repo-fb822bee\.travis.yml'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: glob@4.0.5 (node_modules\ionic\node_modules\npm\node_modules\glob):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, open 'C:\Users\allan\AppData\Roaming\npm\node_modules\.staging\glob-982087a0\glob.js'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: npm-registry-client@3.2.2 (node_modules\ionic\node_modules\npm\node_modules\npm-registry-client):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: EEXIST: file already exists, mkdir 'C:\Users\allan\AppData\Roaming\npm\node_modules\.staging\npm-registry-client-7854918c'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: File exists: C:\Users\allan\AppData\Roaming\npm\node_modules\.staging\npm-registry-client-7854918c
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: abbrev@1.0.5 (node_modules\ionic\node_modules\npm\node_modules\abbrev):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: EEXIST: file already exists, mkdir 'C:\Users\allan\AppData\Roaming\npm\node_modules\.staging\abbrev-ee4c2088'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: File exists: C:\Users\allan\AppData\Roaming\npm\node_modules\.staging\abbrev-ee4c2088
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: normalize-package-data@1.0.3 (node_modules\ionic\node_modules\npm\node_modules\normalize-package-data):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, open 'C:\Users\allan\AppData\Roaming\npm\node_modules\.staging\normalize-package-data-1f7c76af\.travis.yml'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ctype@0.5.2 (node_modules\ionic\node_modules\npm\node_modules\request\node_modules\http-signature\node_modules\ctype):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, utime 'C:\Users\allan\AppData\Roaming\npm\node_modules\.staging\ctype-f5fceade\ctio.js'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ionic-cordova-lib@5.1.7 (node_modules\ionic\node_modules\ionic-app-lib\node_modules\ionic-cordova-lib):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Error: EPERM: operation not permitted, utime 'C:\Users\allan\AppData\Roaming\npm\node_modules\.staging\ionic-cordova-lib-6332126d\src\cordova\build.js'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-gyp@1.0.2 (node_modules\ionic\node_modules\npm\node_modules\node-gyp):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Error: EPERM: operation not permitted, utime 'C:\Users\allan\AppData\Roaming\npm\node_modules\.staging\node-gyp-70a884b6\gyp\pylib\gyp\MSVSUtil.py'

npm ERR! path C:\Users\allan\AppData\Roaming\npm\node_modules\chownr\package.json
npm ERR! code ENOPACKAGEJSON
npm ERR! errno -4058
npm ERR! syscall open
npm ERR! package.json ENOENT: no such file or directory, open 'C:\Users\allan\AppData\Roaming\npm\node_modules\chownr\package.json'
npm ERR! package.json npm can't find a package.json file in your current directory.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\allan\AppData\Roaming\npm-cache\_logs\2017-06-12T18_05_53_987Z-debug.log

Oi Allan,

Curioso que essa URL que ele cospe realmente nao existe, dá 404. Estou chutando que a ultima versao do Ionic 1.x esta com algo errado ao apontar pro node-sass (que é quem esta com problema).

O Ionic 3 mudou tudo, vai ser mais complicado seguir o curso com ele (mas se quiser tentar, a ideia é criar o projeto pelo Ionic e aí rodar o comando de resources).

Pra gente nao desistir ainda o Ionic 1, vamos tentar instalar uma versao especifica anterior?

npm install -g ionic@1.6

Poxa vida, ta dificil isso hehehe.

Se nao for abusar, podemos tentar outras versoes. Eu por exemplo tenho aqui a 1.7.10 funcionando ok (mas tá num Mac).

A instalação da versão 1.7.10 me retorna o mesmo erro da 1.6. Andei dando uma olhada pela internet em como resolver o problema do post principal desta discussão e já tentei instalar o Python e o Visual Studio usando "npm install --global --production windows-build-tools" e depois usando o "npm install --global node-gyp". Tentei fazer as configurações de path para o Python e não consegui, sempre me retornava um erro, geralmente com alguns warnings em amarelo antes do erro em vermelho.

De qualquer forma já estou prosseguindo com o curso. Baixei os ícones e as splash screens e coloquei o código no config.xml manualmente, sem ionic mesmo.

Mesmo problema comigo também :-(

Até consegui instalar o ionic. Depois de muito trabalho.

sudo chown -R $(whoami) ~/.npm
sudo chown -R $(whoami) /usr/local/lib/node_modules
sudo npm  install -g npm-check
sudo npm install -g ionic@1

+ ionic@1.7.16

Mesmo depois de instalado se eu rodar :

ionic resources
module.js:487
    throw err;
    ^

Error: Cannot find module 'ionic-app-lib'
    at Function.Module._resolveFilename (module.js:485:15)
    at Function.Module._load (module.js:437:25)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/ionic/lib/cli.js:3:19)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)

Instalei o ionic-app-lib

 garconapp : sudo npm install ionic-app-lib --save

Mesmo assim :

garconapp ionic resources
errorHandler had an error TypeError: Info.getIonicVersion is not a function
    at Object.gatherInfo (/usr/local/lib/node_modules/ionic/lib/cli.js:494:8)
    at Object.errorHandler (/usr/local/lib/node_modules/ionic/lib/cli.js:514:24)
    at Object.fail (/usr/local/lib/node_modules/ionic-app-lib/lib/utils.js:276:20)
    at Object.run (/usr/local/lib/node_modules/ionic/lib/cli.js:99:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/ionic/bin/ionic:9:10)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
TypeError: Info.getIonicVersion is not a function
    at Object.gatherInfo (/usr/local/lib/node_modules/ionic/lib/cli.js:494:8)
    at Object.errorHandler (/usr/local/lib/node_modules/ionic/lib/cli.js:514:24)
    at Object.fail (/usr/local/lib/node_modules/ionic-app-lib/lib/utils.js:276:20)
    at Object.run (/usr/local/lib/node_modules/ionic/lib/cli.js:99:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/ionic/bin/ionic:9:10)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)

o meu deu problema também. dai "quando vc não pode com o inimigo, junte-se a ele" instalei a versão atual do ionic como o professor orienta

npm install -g ionic

criei um novo projeto com o

ionic start projetoGerarIcone

ele já gera uma pasta resources, dai coloquei as images la. e rodei na pasta do projeto:

ionic cordova resources [<platform>]

ele também gera o config.xml, Copiei só a parte necessária.

rodando o comando, ele vai pedir para criar a conta ionic, rodar o cordova platform add [], mas no fim vai dar certo para todos. Espero... rsrsr