Skip to content

npm start / npm run dev fail with "index.js: SyntaxError: Unexpected token import" #462

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

Closed
brennen opened this issue Feb 17, 2016 · 5 comments

Comments

@brennen
Copy link

brennen commented Feb 17, 2016

Seems to happen for both npm start and npm run dev, even after npm run build:

/home/brennen/parse-server/src/index.js:14
import { GridStoreAdapter } from './Adapters/Files/GridStoreAdapter';
^^^^^^

SyntaxError: Unexpected token import
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:387:25)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.<anonymous> (/home/brennen/parse-server/bin/parse-server:3:19)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)

I gather that this has to do with the version of index.js getting run here not getting transformed by Babel, but after that I'm a bit lost. I have a couple of other reports of this issue, so I think it's tripping up users.

Full debug log here: npm-debug.txt

@brennen brennen changed the title index.js: SyntaxError: Unexpected token import npm start / npm run dev fail with "index.js: SyntaxError: Unexpected token import" Feb 17, 2016
@omairvaiyani
Copy link
Contributor

I believe this is related to Issue 429.

@peterdotjs
Copy link
Contributor

Issue I believe is related to this commit: #399. I'm not sure why this was changed. I'll make a PR to update it.

peterdotjs added a commit that referenced this issue Feb 17, 2016
@peterdotjs
Copy link
Contributor

@brennen if you pull the latest from master you'll be good to go.

@brennen
Copy link
Author

brennen commented Feb 17, 2016

Thanks all!

@mashengdada
Copy link

i solve this problem by change " node ./bin/www" by "babel-node ./bin/www" in package.json file ,of cources npm install some babel plugins

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