This forum has moved, please join us on github discussions. We will keep these old posts available for reference. Thank you!

Updating to latest version

hi,
How can I update my website to the latest version?
thank you
Bruce

shall I just run npm i after modifying the version in package.json?

npm update apostrophe -S did the trick

Glad you figured it out! FYI how-to questions like this should go to Stack Overflow, tagged apostrophe-cms. It makes sure everyone can find the answers.

I’m not sure what you had in your package.json such that plain old “npm update” with no arguments didn’t do the trick for you. But your dependencies will look like this if you make your project following our instructions:

"apostrophe": "^2.0.0"

Which means that a simple “npm update” will update you to the latest in the 2.x stable series, with no need to type “npm update apostrophe” or change anything in package.json.

thank you, I’m new to apostrophe, so I guess I will do stupid things in the beginning

Oh, don’t worry about that! Node was a mysterious wonderland to me once (:

hehe

I’m starting to build my website, wish me luck!

I’m sorry, new here and this seemed like the best thread to add this question to.

I’v run the update and package.json shows 2.20.3 but when I call
apostrophe -V
the result shows
2.0.0

apostrophe-cli 2.0.1 on
Sierra 10.12.4
Node v7.8.0

The reason I ask is I read the GitHub issues saying the following was resolved.
WARNING: No session secret provided, please set the 'secret' property of the 'session' property of the apostrophe-express module in app.js

I’v done as it asked, but continue to see this Warning, and wanted to check here about updating correctly before posting a new issue in GitHub

So I figured it out finally after getting much further into the tutorials

The secret was to create an index.js file in the directory path lib/modules/apostrophe-express

module.exports = {
  session: {
    secret: 'your secret'
  }
}

re:apostrophe-express:sessions
re:apostrophe-core-server:modules

I had to type npm install apostrophe -S, too.

The weird thing is, apostrophe-cli installed 2.47.0 according to the package.json: ^2.47.0
That was last week – when version 2.54.1 was just released.

One more weird thing is that the version contained a caret ^ but a simple npm install didn’t do the trick. Does this have to do with the package-lock.json?

I just did this:

apostrophe create-project testitup
cd testitup
npm install
less node_modules/apostrophe/package.json

And the version is 2.54.3 as I expected.

You might have an old version of the CLI, it’s worth doing npm install -g apostrophe-cli again.

Hm, seems that I misunderstood something. Even if apostrophe-cli installs 2.54.3, the project-level package.json requires 2.47.0 and up.