evgentraytyak / kiwi-api Goto Github PK
View Code? Open in Web Editor NEW:airplane: A Node.js wrapper for the Kiwi.com(Skypicker.com) API
:airplane: A Node.js wrapper for the Kiwi.com(Skypicker.com) API
After inspecting errors further, now I understood the first error (that I was starting to describe below).
So easy fix: npm install unirest -save
, but obviously that's not enough.
Somehow it keeps rejecting the import statement, although I have Node 8.9 installed :-/, but I guess this on is on me.
Appreciate the help
Executing the import statement import KiwiAPI from 'kiwi-api';
immediately triggers an error:
(function (exports, require, module, __filename, __dirname) { import KiwiAPI from 'kiwi-api';
^^^^^^
SyntaxError: Unexpected token import
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:599:28)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
at Function.Module.runMain (module.js:676:10)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3
Or if I compile it first as a typescript file:
module.js:538
throw err;
^
Error: Cannot find module 'unirest'
at Function.Module._resolveFilename (module.js:536:15)
at Function.Module._load (module.js:466:25)
at Module.require (module.js:579:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/Users/davidpanholzer/Desktop/Kiwi node/node_modules/kiwi-api/build/index.js:9:16)
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
Further checking with this out with the debugger:
(node engine) var filename = Module._findPath(request, paths, isMain);
The first time it runs with request = kiwi-api
, the second time unrest
, which is not found anymore leading the following if (filename = false)
statement to throw an error.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.