GALAglobal / TAPICC

The Translation API Cases and Classes (TAPICC) initiative is a collaborative, community-driven, open-source project to advance API standards in the localization industry.
https://galaglobal.github.io/TAPICC/
Other
24 stars 3 forks source link

Error with import #11

Closed ysavourel closed 6 years ago

ysavourel commented 6 years ago

Trying to run the develop branch I'm getting this error:

error: A hook (`controllers`) failed to load!
error: `include-all` attempted to `require(C:\Dev\GALA-TAPICC-server\dev\trunk\src\api\controllers\AssetController.ts)`, but an error occurred::
Details:C:\Dev\GALA-TAPICC-server\dev\trunk\src\api\controllers\AssetController.ts:7
import express = require('express');
^^^^^^

It seems import is not supported with all versions of Node. Is there some minimal version required here?

Thanks

Alino commented 6 years ago

when I run node --version I get v9.3.0

So I would say v9.3.0 is minimal version.

ysavourel commented 6 years ago

It seems even 9.9.0 (current latest) does not support import by default. See https://stackoverflow.com/questions/39436322/node-js-syntaxerror-unexpected-token-import

Maybe we could use older but more backward compatible statements?

Alino commented 6 years ago

can you please describe the steps, how are you trying to run the server, what commands do you use?

maybe instead of sails lift you can try npm start which uses ts-node instead of node. ts-node supports typescript, and typescript supports ecmascript6 statements such as import, export

ysavourel commented 6 years ago

I've followed the readme: npm install then sails lift (after installing Sails)

But it looks like you've updated the readme, and indeed with npm start the server starts and http://localhost:1337 is running. Thanks.