npm types code example Example 1: npm for node types npm i @types/node Example 2: npm typescript npm install -g typescript