Backendless is not defined using node

Mission: CRUD ROOKIE
Task: Add Object With API

Please, describe your problem here.

I’m trying to work through the missions, and I’m completely stuck. After an hour of googling, I can’t figure out what the problem is. I spun up a new node module, installed the backendless dependency with npm, and when I attempt to run the sample script, I’m met with an error. “Backendless is not defined”

From what I know about Node, all the dependencies should be available to the start script. And I haven’t added anything special. Just the default settings. Latest versions of Node, npm, and backendless.

How do I connect the script with the library if the npm install method isn’t working?

Hello @Grey_Elerson,

have you tried require module at the top of the file?
const Backendless = require('backendless')

Regards,
Stanislaw

2 Likes

I hadn’t, since that’s not in the sample of the documentation or in the mission code sample, but that fixed the issue.

Maybe somebody should update that for us noobs.

Thanks

Thanks Grey! Saved me those hours of work! They still haven’t updated the docs on that one… :slight_smile:

THANK YOU :slight_smile: