Welcome to the Linux Foundation Forum!

ReferenceError: add is not defined - Working with CLI Tools

When completing the Working with CLI Tools lesson remember to update the imported function names in cmd.js

import {update, **add**} from "../src/utils.js";

This instruction is missing from the lesson. The following error will occur when trying to add products from the command line:

PS  C:\Users\...\my-cli> my-cli add electronics A3 Laptop 599 "Best mid-priced laptop money can buy"
...
      await add(category, id, name, amount, info)
      ^

ReferenceError: add is not defined
...

Categories

Upcoming Training