obsidianmd / obsidian-sample-plugin

2.61k stars 924 forks source link

Can't build plugin with npm run dev #57

Closed AlexAnder1946 closed 1 year ago

AlexAnder1946 commented 1 year ago

hi, i clone the repo and install all dependencies and give me this error when i run npm run dev:

> obsidian-sample-plugin@1.0.0 dev
> node esbuild.config.mjs

file:///home/alex/Objectives/LifeVault/.obsidian/plugins/Life_app_Obsidina_pluging/esbuild.config.mjs:14
const context = await esbuild.context({
                ^^^^^

SyntaxError: Unexpected reserved word
    at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18)
    at async link (internal/modules/esm/module_job.js:42:21)

I don't understand, it seems like an error in the esbuild library, although I really have no idea, I'm quite an amateur

lishid commented 1 year ago

What's your NodeJS version?

AlexAnder1946 commented 1 year ago

system: ubuntu 22.04 Nodejs - v12.22.9 i find out that is to old , i will update and try

lishid commented 1 year ago

Yeah you need a node upgrade. I would go for something newer like 16 or 18.