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

Unexpected token import at import fs from 'fs-extra' #123

Closed
chauhanshubham-dev opened this issue Feb 8, 2016 · 3 comments
Closed

Unexpected token import at import fs from 'fs-extra' #123

chauhanshubham-dev opened this issue Feb 8, 2016 · 3 comments

Comments

@chauhanshubham-dev
Copy link

My gatsby version 0.7.7 and throws this error while running the command
gatsby new bloggy https://github.com/gatsbyjs/gatsby-starter-blog

import fs from 'fs-extra'
^^^^^^

SyntaxError: Unexpected token import
    at exports.runInThisContext (vm.js:54:16)
    at Module._compile (module.js:375:25)
    at Module._extensions..js (module.js:406:10)
    at Object.require.extensions.(anonymous function) [as .js] (/usr/local/lib/node_modules/gatsby/node_modules/babel-core/lib/api/register/node.js:214:7)
    at Module.load (/usr/local/lib/node_modules/gatsby/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
    at Function.Module._load (module.js:302:12)
    at Module.require (module.js:355:17)
    at require (internal/module.js:13:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/gatsby/bin/new.coffee:13:19)
    at Object.<anonymous> (/usr/local/lib/node_modules/gatsby/bin/new.coffee:35:4)
    at Module._compile (module.js:399:26)
    at Object.loadFile (/usr/local/lib/node_modules/gatsby/node_modules/coffee-script/lib/coffee-script/register.js:16:19)
    at Module.load (/usr/local/lib/node_modules/gatsby/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
    at Function.Module._load (module.js:302:12)
    at Module.require (module.js:355:17)
    at require (internal/module.js:13:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/gatsby/bin/gatsby-new.js:5:1)
    at Module._compile (module.js:399:26)
    at Object.Module._extensions..js (module.js:406:10)
    at Module.load (module.js:345:32)
    at Function.Module._load (module.js:302:12)
    at Function.Module.runMain (module.js:431:10)
    at startup (node.js:141:18)
@KyleAMathews
Copy link
Contributor

Hi is this from a global install e.g. "npm install -g gatsby"?
On Mon, Feb 8, 2016 at 12:15 PM Shubham Chauhan notifications@github.com
wrote:

My gatsby version 0.7.7 and throws this error while running the command
gatsby new bloggy https://github.com/gatsbyjs/gatsby-starter-blog

import fs from 'fs-extra'
^^^^^^

SyntaxError: Unexpected token import
at exports.runInThisContext (vm.js:54:16)
at Module._compile (module.js:375:25)
at Module._extensions..js (module.js:406:10)
at Object.require.extensions.(anonymous function) as .js
at Module.load (/usr/local/lib/node_modules/gatsby/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
at Function.Module._load (module.js:302:12)
at Module.require (module.js:355:17)
at require (internal/module.js:13:17)
at Object. (/usr/local/lib/node_modules/gatsby/bin/new.coffee:13:19)
at Object. (/usr/local/lib/node_modules/gatsby/bin/new.coffee:35:4)
at Module._compile (module.js:399:26)
at Object.loadFile (/usr/local/lib/node_modules/gatsby/node_modules/coffee-script/lib/coffee-script/register.js:16:19)
at Module.load (/usr/local/lib/node_modules/gatsby/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
at Function.Module._load (module.js:302:12)
at Module.require (module.js:355:17)
at require (internal/module.js:13:17)
at Object. (/usr/local/lib/node_modules/gatsby/bin/gatsby-new.js:5:1)
at Module._compile (module.js:399:26)
at Object.Module._extensions..js (module.js:406:10)
at Module.load (module.js:345:32)
at Function.Module._load (module.js:302:12)
at Function.Module.runMain (module.js:431:10)
at startup (node.js:141:18)


Reply to this email directly or view it on GitHub
#123.

@chauhanshubham-dev
Copy link
Author

so, I tried the installation, using global install and install from source, and can't remember which would have caused that to happen.
Does that makes a difference? Any ideas please let me know. I'll try once again and, keep you posted on this.

@KyleAMathews
Copy link
Contributor

Should be fixed in 0.8, let me know if not.

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

2 participants