After doing a clean wipe and install of OSX I had to reinstall a few things including Node.js
How I installed npm (MacOS)
- After the clean install I had no npx or npm so I did the following on Macbook Pro
- click Node.js download and see this Latest LTS Version: 18.12.0 (includes npm 8.19.2)
- Click LTS
- click MacOS installer, or whatever operating system you use Windows, Linux, MacOS are all available for Node.js
- note: Latest LTS Version of Node.js as of 10/31/2022 = 18.12.0 and that includes npm 8.19.2
- download Node.js pkg to Macbook Pro and iMac
- open the pkg installer and see this
This package will install:
• Node.js v18.12.0 to /usr/local/bin/node
• npm v8.19.2 to /usr/local/bin/npm
- click continue
- Agree to the terms and continue and it will ask you for your admin password and finish the install.
This package has installed:
• Node.js v18.12.0 to /usr/local/bin/node
• npm v8.19.2 to /usr/local/bin/npm
Make sure that /usr/local/bin is in your $PATH.
type this command into terminal and see ...
% npm --version
8.19.2
- no issues, npx is an easy 2 min install
- now type the following commands into Terminal. First go to the folder where you have 11ty installed. I have mine installed local to the Site I am working on which is 11ty-ahs so cd there then check what version of 11ty is running.
% pwd
/Users/edh/Sites
% cd 11ty-ahs
% npx @11ty/eleventy --version
1.0.2
- type this command to build your 11ty Site
- npx @11ty/eleventy --serve