sintaxi / surge

CLI for the surge.sh CDN
https://surge.sh
2.85k stars 136 forks source link

startup error #320

Closed Artucuno closed 3 years ago

Artucuno commented 6 years ago
/usr/local/lib/node_modules/surge/node_modules/inquirer/lib/prompts/list.js:32
      let index = _.findIndex(this.opt.choices.realChoices, ({ value }) => value === def);
                                                             ^

SyntaxError: Unexpected token {
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Function.promptModule.restoreDefaultPrompts (/usr/local/lib/node_modules/surge/node_modules/inquirer/lib/inquirer.js:55:33)
    at Object.inquirer.createPromptModule (/usr/local/lib/node_modules/surge/node_modules/inquirer/lib/inquirer.js:65:16)
    at Object.<anonymous> (/usr/local/lib/node_modules/surge/node_modules/inquirer/lib/inquirer.js:77:28)
Artucuno commented 6 years ago

HELP ME

sintaxi commented 6 years ago

Hey, are you on the latest version of surge? Try running npm install -g surge.

aowongster commented 6 years ago

I am also running into this issue. I just installed surge.

I'm using NVM on OSX

node --version
v5.10.0

npm --version
3.8.3

npm install -g surge
npm WARN deprecated du@0.1.0: no longer maintained
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp
 DoS issue
/Users/aowongster/.nvm/versions/node/v5.10.0/bin/surge -> /Users/aowongster/.nvm/versions/node/v5.10.0
/lib/node_modules/surge/lib/cli.js
/Users/aowongster/.nvm/versions/node/v5.10.0/lib
└── surge@0.20.1

npm list surge
gatsby-starter-hello-world@ /Users/aowongster/play/gatsby/tutorial-part-one
└── (empty)

npm ERR! code 1
sintaxi commented 6 years ago

@aowongster node v5.10.0 is outdated and considered unstable at the time of its release. Any chance you are able to update your version of node to v6.x? or newer?

aowongster commented 6 years ago

Thanks, @sintaxi I upgraded to v6.6.0 and surged deployed just fine.

Artucuno commented 6 years ago

how do i update minimatch?

Artucuno commented 6 years ago

and its still showing the error

smed79 commented 6 years ago

/usr/local/lib/node_modules/surge/node_modules/inquirer/lib/prompts/list.js:32

fixed for me

sudo apt clean
sudo apt remove --purge nodejs
sudo apt remove --purge npm
sudo apt autoremove
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs npm gcc g++ make
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install yarn