Doc > Getting Started > Upgrading

Doc > Getting Started > Upgrading

In the previous section, we've seen how to install the polygonjs-editor dependencies, which would allow you to make sure that your project is tied to a specific version. But we haven't yet seen how to run that specific version.

So here is how it works.

If we look again at the content of the package.json file:

{
    "engines": {
        "node": ">=16.13.1",
        "yarn": ">=1.22.7"
    },
    "scripts": {
        "polygon": "polygonjs-editor --port=8091"
    },
    "dependencies": {
        "polygonjs-editor": "1.1.209-1"
    }
}

Let's now pay attention to the script section, which contains a line with: node polygonjs-editor --port=8091.

What that does is run the polygonjs-editor version that is installed inside the node_modules. And the way to run it is with:

npm run polygon

Or if you are using yarn:

yarn polygon

By starting polygonjs this way, your project will never break, even if you use a more recent version of Polygonjs in other projects.

But what if you want to upgrade? It's actually very easy.

All you need to do it change the version in that package.json. So let's update it to 1.1.210-1:

{
    ...
    "dependencies": {
        "polygonjs-editor": "1.1.210-1"
    }
}

Save the file, and then run either npm install or yarn.

And now, when you run npm run polygon or yarn polygon, version 1.1.210-1 will be used.