Checking versions of aurelia-* installed with aurelia-cli


#1

I’m using the latest nodejs 8.9.0, npm 5.5.1 and aurelia-cli 0.32.0.

I have a number of questions:

  1. Where can you see the version numbers of the core aurelia apps (aurelia-framework, aurelia-router etc)? I looked through package.json and there are no references to these packages. Neither can I find any references in aurelia-json

  2. On running npm ls aurelia-binding I can see the version number which is 1.2.2 (the app was created some months ago). However, I know that the latest version is 1.5.4, so I ran npm install, and the version remained at 1.2.2.

  3. I deleted the node-modules folder and then ran npm install again, expecting it to pull in the latest versions, but they remain as previously - 1.2.2.

  4. I then created a brand new project using au new --here and the correct latest versions were installed.

This is all very confusing. Obviously there is some kind of “hidden” `package.json" somewhere.

… some time later …

After a bit more research, I see that the problem is that package-json.lock is what is causing the problem. So what is the best practice for updating aurelia using npm?

I would appreciate any help.

Many thanks


#2

Update

Evidently I had created the original app with an earlier version of npm, which apparently had a bug related to package-json.lock.

For anyone else that runs across this problem, you need to delete the node-modules folder, delete package-json.lock and then run npm install again. It recreates the package-json.lock file, which according to the thread at https://github.com/npm/npm/issues/16866 should now work as expected. (I haven’t tested it yet).

However, my original question still stands - where can you see the versions of aurelia-* that aurelia-cli is pulling in?

I have very little understanding of how npm works - I just use npm install and npm ls. Given that aurelia-cli does such a good job of hiding so much of the previous installation “nightmares” I think it might be worthy of mentioning this in the getting started documentation. (And yes - I know this is an npm problem and not an issue with aurelia).


#3

@jeremyholt try checking the package.json of aurelia-cli package in your node_modules folder.


#4

No - it doesn’t show the references. aurelia-cli/package.json

{
  "_from": "aurelia-cli@0.32.0",
  "_id": "aurelia-cli@0.32.0",
  "_inBundle": false,
  "_integrity": "sha1-+UUxZufnVodEKWqXNSDqOJb8nRE=",
  "_location": "/aurelia-cli",
  "_phantomChildren": {},
  "_requested": {
    "type": "version",
    "registry": true,
    "raw": "aurelia-cli@0.32.0",
    "name": "aurelia-cli",
    "escapedName": "aurelia-cli",
    "rawSpec": "0.32.0",
    "saveSpec": null,
    "fetchSpec": "0.32.0"
  },
  "_requiredBy": [
    "#DEV:/",
    "#USER"
  ],
  "_resolved": "https://registry.npmjs.org/aurelia-cli/-/aurelia-cli-0.32.0.tgz",
  "_shasum": "f9453166e7e7568744296a973520ea3896fc9d11",
  "_spec": "aurelia-cli@0.32.0",
  "_where": "C:\\Visual Studio\\AtlTradingSystem\\Client",
  "author": {
    "name": "Rob Eisenberg",
    "email": "rob@bluespire.com",
    "url": "http://robeisenberg.com/"
  },
  "bin": {
    "aurelia": "bin/aurelia-cli.js",
    "au": "bin/aurelia-cli.js"
  },
  "bugs": {
    "url": "https://github.com/aurelia/cli/issues"
  },
  "bundleDependencies": false,
  "dependencies": {
    "aurelia-dependency-injection": "^1.0.0",
    "aurelia-logging": "^1.2.0",
    "aurelia-polyfills": "^1.0.0",
    "esprima": "^4.0.0",
    "glob": "^7.1.1",
    "npm": "^3.10.8",
    "npm-which": "^3.0.1",
    "preprocess": "^3.1.0",
    "rfc6902": "^1.2.2",
    "semver": "^5.3.0"
  },
  "deprecated": false,
  "description": "The command line tooling for Aurelia.",
  "devDependencies": {
    "aurelia-tools": "^0.2.4",
    "babel-eslint": "^7.1.1",
    "gulp": "^3.9.1",
    "gulp-bump": "^2.7.0",
    "gulp-conventional-changelog": "^1.1.3",
    "gulp-eslint": "^3.0.1",
    "jasmine": "^2.5.2",
    "jasmine-spec-reporter": "^4.2.1",
    "latest-version": "^3.1.0",
    "minimatch": "^3.0.4",
    "mock-fs": "^4.2.0",
    "nodemon": "^1.11.0",
    "require-dir": "^0.3.1",
    "run-sequence": "^1.2.2",
    "yargs": "^7.0.2"
  },
  "homepage": "http://aurelia.io",
  "keywords": [
    "aurelia",
    "cli",
    "bundle",
    "scaffold"
  ],
  "license": "MIT",
  "main": "lib/index.js",
  "name": "aurelia-cli",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/aurelia/cli.git"
  },
  "scripts": {
    "test": "jasmine",
    "test:watch": "nodemon -x 'npm test'"
  },
  "version": "0.32.0"
}

In addition, recreating the package-lock.json as I described above still doesn’t work. I ended up running npm config set package-lock false and then manually deleting package-lock.json.


#5

Ok. I can see that aurelia-cli generates a package.json which includes aurelia-bootstrapper at a specific version. Aurelia-bootstrapper has all the core aurelia-* dependencies at specific versions. Does this answer your question?


#6

Ah yes - that does answer the question.

However, it leads to another one … namely where can I see a list of the latest versions of aurelia? I can’t seem to find it on github.

I apologize if I’m sounding really pedantic, but all of these questions arose from the original problem with package-json.lock where after reading about the latest updates on the aurelia blog, I thought I was updating to the latest and greatest, and hadn’t realized that I was stuck at old versions.


#7

As far as I know, there is no easy way to do this with the CLI. The version are specified in your package.json file only if you specify them manually or install a package with an explicit version (eg npm install aurelia-framework@1.0.1). But then you only have the installed version, not the lastest available.

On github, you can find all aurelia related project on https://github.com/aurelia/ A search on npm can also prove useful I think: https://www.npmjs.com/search?q=aurelia

If you use VSCode, it will displays the last version number of a package when you open your package.json and hover on the name of the package. That’s how I view which package are available.

Every time a release is available a blog post is created on the blog.