Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SyntaxError: Unexpected token import #30

Closed
bompi88 opened this issue Jan 18, 2016 · 6 comments
Closed

SyntaxError: Unexpected token import #30

bompi88 opened this issue Jan 18, 2016 · 6 comments

Comments

@bompi88
Copy link

bompi88 commented Jan 18, 2016

This port of the old mup looks really promising! I have a problem though, maybe bacause of my poor knowledge about running node modules that use babel. I followed the steps in the README.md and got the following SyntaxError when running mup init on my project:

$ mup init

/usr/local/lib/node_modules/mup/lib/execute.js:1
(function (exports, require, module, __filename, __dirname) { import modules from './modules/';
                                                              ^^^^^^

SyntaxError: Unexpected token import
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:374:25)
    at Module._extensions..js (module.js:405:10)
    at Object.require.extensions.(anonymous function) [as .js] (/usr/local/lib/node_modules/mup/node_modules/babel-register/lib/node.js:138:7)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/mup/index.js:12:1)
    at Module._compile (module.js:398:26)

I'm running OS X 10.11.1 and my current versions of related utilities are:

  • node 5.4.0
  • npm 3.3.12

EDIT: If I run mup inside dev folder it works as expected:

node ~/projects/meteor-up/index.js init
@madushan1000
Copy link
Contributor

Knoladge with babel won't be an issue since we are hoping to ship a compiled code in the future. It seems like this is caused by npm install -g not properly linking the binary. I'll try to find what is the exact cause. For now, try this to get it working. (do npm remove -g if you have already installed)

npm install
npm link

@bompi88
Copy link
Author

bompi88 commented Jan 19, 2016

Thanks @madushan1000 , that did the trick 👍

@madushan1000
Copy link
Contributor

I hope this is resolved now? I'm closing this issue, feel free to reopen if not.

@Ben305
Copy link

Ben305 commented Mar 4, 2016

I have the same problem, it's not working with npm install -g, but is working when using install and link

@madushan1000
Copy link
Contributor

We are hoping to ship transpiled version of code in a few days.

@gamedevsam
Copy link

This saved my life:

EDIT: If I run mup inside dev folder it works as expected:

node ~/projects/meteor-up/index.js init

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants