How can I solve error gypgyp ERR!ERR! find VSfind VS msvs_version not set from command line or npm config?

TL;DR Use the Visual Studio Installer to get the Desktop development with C++ workload in one of the Visual Studio versions you have installed in your machine: Reason/Details Reading through the log, the main error is due to this: msvs_version not set from command line or npm config After this one you find a few … Read more

Can’t run my Node.js Typescript project TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension “.ts” for /app/src/App.ts

Remove “type”: “module” from package.json https://github.com/TypeStrong/ts-node/issues/935 https://github.com/TypeStrong/ts-node/issues/1007#issuecomment-1163471306 If you don’t want to remove “type”: “module” (for example if you’re using import statements in your .ts which allows the inference of types from modules), then you can use the following option in tsconfig.json: { “compilerOptions”: { “esModuleInterop”: true, } } And then you can start the … Read more

Read a file in Node.js

Use path.join(__dirname, ‘/start.html’); var fs = require(‘fs’), path = require(‘path’), filePath = path.join(__dirname, ‘start.html’); fs.readFile(filePath, {encoding: ‘utf-8’}, function(err,data){ if (!err) { console.log(‘received data: ‘ + data); response.writeHead(200, {‘Content-Type’: ‘text/html’}); response.write(data); response.end(); } else { console.log(err); } }); Thanks to dc5.