Node + npm + Clasp version?
in Terminal >
in Terminal >
node -v
npm -v
clasp --version
Je Chromebook is helemaal klaar:
Node.js v24.22.0 ✅
npm 11.19.1 ✅
Clasp 3.4.1 ✅
Prerequisites
Install Node.js: Download and install Node.js. This includes npm (Node Package Manager).
Enable the Apps Script API: You must give clasp permission to access your scripts.
Go to the Google Apps Script User Settings.
Toggle Google Apps Script API to ON.
Step 1: Install clasp
Open your terminal (or Command Prompt) and run the following command to install clasp globally on your system:
bash
npm install -g @google/clasp
Use code with caution.
Step 2: Log In to Google
Link clasp to your Google account by running:
bash
clasp login
Use code with caution.
Your browser will automatically open. Log into the Google account that holds your Apps Script projects and grant the requested permissions.
Step 3: Start a Project
You can either download an existing online project or create a brand new one locally.
Option A: Clone an existing project
Find the Script ID of your existing project (go to your online script, click Project Settings ⚙️, and copy the Script ID). Then run:
bash
clasp clone "YOUR_SCRIPT_ID"
Use code with caution.
Option B: Create a new project
Create a new folder on your computer, navigate into it, and initialize a new script:
bash
mkdir my-script-project
cd my-script-project
clasp create --title "My New Script" --type standalone
Use code with caution.
(You can change --type to sheets, docs, or forms if you want the script bound to a specific Google file).
Step 4: Write, Pull, and Push Code
Now you can open the project folder in your favorite editor (like Visual Studio Code) and write your JavaScript or TypeScript files.
Upload changes to Google: After editing your files locally, push them to the cloud:
bash
clasp push
Use code with caution.
Download changes from Google: If you made quick edits directly in the browser editor, pull those changes to your computer:
bash
clasp pull
Use code with caution.
Open the browser editor quickly: If you want to check the online interface, this command opens the project directly in your browser:
bash
clasp open
Use code with caution.
Core Commands Reference
Command
Description
clasp login / logout
Log into or out of your Google account.
clasp clone <scriptId>
Clone an existing remote project.
clasp create
Create a brand new script project.
clasp pull
Fetch remote code and overwrite local files.
clasp push
Upload local code changes to Google.
clasp open
Open the current project in the Apps Script browser editor.
clasp deployments / deploy
Manage or create web app and add-on deployments.
Would you like assistance with setting up TypeScript autocompletion for your local project, or do you need help setting up a Git repository for your code?
AI responses may include mistakes. Learn more