filecoin-client-tutorial
filecoin-client-tutorial copied to clipboard
SyntaxError: Unexpected token import
Hi, I am running Node v8.10.0 on Ubuntu18.04.
When I ran the project with node server.js, it showed a syntax error at the import statement.
How do you get around this?
Thanks!
@jacky6016 if you could try upgrading your version of node that might help.
I upgraded Node to 14.5.0 and change server.js to server.mjs. It can run now.
Doesn't work for me either.
Node - 14.7.0 (LTS) Npm - 6.14.7
Works if you change to
const express = require('express');
const fs = require("fs");
const { ffs, createPow } = require("@textile/powergate-client")
Also, you need to change the placing of some of the variable instantiations.
@lpfloyd I don't think this example has been kept up to date, if you could send a PR that would be great