Answer the question
In order to leave comments, you need to log in
Error while importing node js?
The mistake itself
import httpRequest from './httpRequest';
^^^^^^^^^^^
SyntaxError: Unexpected identifier
import httpRequest from './httpRequest';
const http = require('http');
const PORT = 3000;
const app = http.createServer((req: any, res: any) => {
res.end('Hello World!\n');
httpRequest.sendRequest(idContract, accessToken);
});
app.listen(PORT);
console.log('Сервер запущен на порте 3000');
{
"compileOnSave": false,
"compilerOptions": {
"importHelpers": true,
"outDir": "./dist/out-tsc",
"baseUrl": "./",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2016",
"dom",
"esnext.asynciterable",
"esnext.array",
"es2017.object"
],
"module": "es2015"
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question