1
resposta

Não consigo instalar o ionic

Estou utilizando a versão do Node 6.11.5

Quando eu executo o comando npm install -g ionic@2.2.1 cordova@6.5.0 gera o erro abaixo npm ERR! Invalid or unexpected token

Este é o log gerado: 0 info it worked if it ends with ok 1 verbose cli [ 'C:\Program Files\nodejs\node.exe', 1 verbose cli 'C:\Users\erick\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js', 1 verbose cli 'install', 1 verbose cli '-g', 1 verbose cli 'ionic@2.2.1', 1 verbose cli 'cordova@6.5.0' ] 2 info using npm@5.4.2 3 info using node@v6.11.5 4 verbose stack C:\Users\erick\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\direct_resolve.js:1 4 verbose stack (function (exports, require, module, filename, dirname) { ���c 4 verbose stack ^ 4 verbose stack 4 verbose stack SyntaxError: Invalid or unexpected token 4 verbose stack at createScript (vm.js:56:10) 4 verbose stack at Object.runInThisContext (vm.js:97:10) 4 verbose stack at Module._compile (module.js:542:28) 4 verbose stack at Object.Module._extensions..js (module.js:579:10) 4 verbose stack at Module.load (module.js:487:32) 4 verbose stack at tryModuleLoad (module.js:446:12) 4 verbose stack at Function.Module._load (module.js:438:3) 4 verbose stack at Module.require (module.js:497:17) 4 verbose stack at require (internal/module.js:20:19) 4 verbose stack at module.exports (C:\Users\erick\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:731:1) 4 verbose stack at Object. (C:\Users\erick\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\bluebird.js:9:36) 4 verbose stack at Module._compile (module.js:570:32) 4 verbose stack at Object.Module._extensions..js (module.js:579:10) 4 verbose stack at Module.load (module.js:487:32) 4 verbose stack at tryModuleLoad (module.js:446:12) 4 verbose stack at Function.Module._load (module.js:438:3) 5 verbose cwd C:\Windows\system32 6 verbose Windows_NT 6.3.9600 7 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Users\erick\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install" "-g" "ionic@2.2.1" "cordova@6.5.0" 8 verbose node v6.11.5 9 verbose npm v5.4.2 10 error Invalid or unexpected token 11 verbose exit [ 1, true ]

1 resposta

Digita

npm cache clean

Depois fecha tudo e abra o terminal como admnistrador e tenta de novo