Currently we're using nodeJS v12.14.1. IIRC there's a new LTS but Emre asked that we stay on this version due to issues upgrading the web wallet.
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
nvm ls-remote
nvm ls
nvm install v12.14.1
nvm use 12.14.1
nvm default 12.14.1
# With TypeScript.
npm install -g typescript
npm install -g ts-node
# Execute a script as `node` + `tsc`.
ts-node script.ts
# Starts a TypeScript REPL.
ts-node
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"lib": ["es2015", "dom"],
"allowJs": true,
"skipLibCheck": true,
"sourceMap": true,
"outDir": "dist",
"strict": true,
"noImplicitAny": true,
"moduleResolution": "node",
"baseUrl": "./",
"esModuleInterop": true
},
"include": ["*"],
"exclude": ["node_modules"]
}
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}/FILENAME-TO-CHANGE.ts",
"preLaunchTask": "tsc: build - tsconfig.json",
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
]
}
]
}
- Add breakpoinst to
FILENAME-TO-CHANGE
from the previous step. - Open the "Run" tab with
cmd+shift+D
. - Have the top dropdown menu read "Launch Program" and click the green "Start Debugging" play button.
- If you see a popup error click "Debug Anyway"
- You'll now be debugging. You can step over/in/out of functions. You can observe the stack. You can inspect variable values and call methods from the debug terminal tab.