yo icon indicating copy to clipboard operation
yo copied to clipboard

SyntaxError: Unexpected token after Installing CLI

Open gilbertlucas46 opened this issue 6 years ago • 1 comments

Type of issue

Bug


My environment

  • OS version/details: Macbook Pro El Capitan
  • Node version: 8.11.1
  • npm version: 5.6.0
  • Version of yo : SyntaxError while running yo commands so I can't check

Expected behavior

I Received this error while running yo wordpress

SyntaxError: Unexpected token %
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:616:28)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/yo/node_modules/insight/node_modules/inquirer/lib/ui/baseUI.js:3:22)

I recently installed yeoman and I confirm that it finished properly

here's the results after I installed yeoman using npm install --global yo

/usr/local/bin/yo -> /usr/local/lib/node_modules/yo/lib/cli.js
/usr/local/bin/yo-complete -> /usr/local/lib/node_modules/yo/lib/completion/index.js

> [email protected] postinstall /usr/local/lib/node_modules/yo
> yodoctor


Yeoman Doctor
Running sanity checks on your system

✔ Global configuration file is valid
✔ NODE_PATH matches the npm root
✔ Node.js version
✔ No .bowerrc file in home directory
✔ No .yo-rc.json file in home directory
✔ npm version

Everything looks all right!
+ [email protected]
updated 1 package in 21.86s
gilberts-MBP:~ gilbertlucas$

But when I check if its installed yo --version

I see the same Syntax error above

SyntaxError: Unexpected token by the way I followed this instructions on how to install wordpress using npm: http://selfteach.me/set-up-wordpress-site-smart/

Current behavior

Steps to reproduce the behavior

Basicall I just installed Yeoman

Command line output

Paste your error output over here
SyntaxError: Unexpected token %
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:616:28)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/yo/node_modules/insight/node_modules/inquirer/lib/ui/baseUI.js:3:22)

gilbertlucas46 avatar Apr 09 '18 01:04 gilbertlucas46

@gilbertlucas46 Hey! by any chance, did you find a solution to this and remember how?

jymjam avatar Jan 23 '22 14:01 jymjam