Skip to Content
0 likes
Fix "Cannot use import statement outside a module" Level: Intermediate

The file was loaded as a classic script or CommonJS, where import isn't allowed. The fix in the browser is type="module". In Node it's "type": "module" or .mjs, and recent npm init writes "type": "commonjs" for you.

0 likes
Install Node.js and Check It Actually Works Level: Intermediate

Install the LTS version of Node.js, check the installer's signature, and prove it works in a new terminal with node -v, npm -v and one real install. Plus the fixes for "not recognized" and the wrong version showing.

0 likes
npm install vs npm ci: Same Install on Every Machine Level: Intermediate

Use npm ci to install exactly what the lock file says and npm install to change it. What each command does, when to use which, and how to fix "npm ci can only install packages when your package.json and package-lock.json are in sync".

0 likes
Build and Publish a Small npm Package Level: Advanced

Set up name, version, exports and files in package.json, check exactly what ships with npm pack --dry-run, then publish with npm publish. Mistakes in a published version can't be undone.