Problems with the CLI

I thought I would have a go with the CLI.

I followed the instructions - I had the latest NODEJS 9.9.0 - and it certainly created the project with all the dependencies however it actually never finishes loading in GIT BASH…

It hangs straight after “Happy Coding”… I close the window and I get this:

CLI%20crash

It DOES finish in Microsoft powershell but when you cd to the directory and try and run it I get the error below.

Now I thought it might be NODEJS being 9.9.0. I uninstalled this version and installed 8.10.0 and I am getting the exact same outcome

I cd to the directory and run “au build” (or “au run”) and the following error happens.

ERROR in C:\Users\simon\Documents\1. AURELIA\CLI\PROJECTS\Typeahead\test\jest-pretest.ts
[tsl] ERROR in C:\Users\simon\Documents\1. AURELIA\CLI\PROJECTS\Typeahead\test\jest-pretest.ts(3,9)
      TS2305: Module '"C:/Users/simon/Documents/1. AURELIA/CLI/PROJECTS/Typeahead/node_modules/aurelia-pal-nodejs/dist/index"' has no exported member 'globalize'.

I did look up for the error “has no exported member ‘globalize’.” and there is precious nothing on it.

I was hoping this would work out of the box…

Why is it erroring like this and what has to be done to fix it?

Here is the full Powershell transcript with me running yarn manually - same error…

  Project Configuration

      Name: Typeahead
      Platform: Web
      Bundler: Webpack
      Loader: None
      Transpiler: TypeScript
      Markup Processor: Minimal Minification
      CSS Processor: None
      Unit Test Runner: Jest
      Unit Test Runner: Karma
      Integration Test Runner: None
      Editor: Visual Studio Code


  Would you like to create this project?

  1. Yes (Default)
    Creates the project structure based on your selections.
  2. Restart
    Restarts the wizard, allowing you to make different selections.
  3. Abort
    Aborts the new project wizard.

  [Yes]> 1
  Project structure created and configured.


  Would you like to install the project dependencies?

  1. Yes (Default)
    Installs all server, client and tooling dependencies needed to build the project.
  2. No
    Completes the new project wizard without installing dependencies.

  [Yes]> 2

  Dependencies not installed.
  PS C:\Users\simon\Documents\1. AURELIA\CLI\PROJECTS> cd Typeahead
  PS C:\Users\simon\Documents\1. AURELIA\CLI\PROJECTS\Typeahead> yarn
  yarn install v1.2.1
  info No lockfile found.
  [1/5] Validating package.json...
  [2/5] Resolving packages...
  warning aurelia-cli > npm > npm-profile > make-fetch-happen > socks-proxy-agent > socks@1.1.10: If using 2.x branch, please upgrade to at least 2.1.6 to avoid a serious bug with socket data flow and an import issue introduced in 2.1.0
  warning gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
  warning karma > log4js > nodemailer@2.7.2: All versions below 4.0.1 of Nodemailer are deprecated. See https://nodemailer.com/status/
  warning karma > log4js > nodemailer > socks@1.1.9: If using 2.x branch, please upgrade to at least 2.1.6 to avoid a serious bug with socket data flow and an import issue introduced in 2.1.0
  warning karma > log4js > loggly > request > node-uuid@1.4.8: Use uuid module instead
  warning karma > log4js > nodemailer > mailcomposer@4.0.1: This project is unmaintained
  warning karma > log4js > mailgun-js > proxy-agent > socks-proxy-agent > socks@1.1.10: If using 2.x branch, please upgrade to at least 2.1.6 to avoid a serious bug with socket data flow and an import issue introduced in 2.1.0
  warning karma > log4js > nodemailer > mailcomposer > buildmail@4.0.1: This project is unmaintained
  warning webpack-cli > jscodeshift > babel-preset-es2015@6.24.1: 🙌  Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!
  warning webpack-cli > jscodeshift > nomnom@1.8.1: Package no longer supported. Contact support@npmjs.com for more info.
  [3/5] Fetching packages...
  info fsevents@1.1.3: The platform "win32" is incompatible with this module.
  info "fsevents@1.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
  [4/5] Linking dependencies...
  warning "aurelia-tools@2.0.0" has unmet peer dependency "babel-eslint@^7.2.3".
  warning "aurelia-tools@2.0.0" has unmet peer dependency "eslint@^4.0.0".
  warning "babel-jest@23.0.0-alpha.4" has unmet peer dependency "babel-core@^6.0.0 || ^7.0.0-0".
  warning "istanbul-instrumenter-loader@3.0.0" has incorrect peer dependency "webpack@^2.0.0 || ^3.0.0".
  [5/5] Building fresh packages...
  success Saved lockfile.
  Done in 45.11s.
  PS C:\Users\simon\Documents\1. AURELIA\CLI\PROJECTS\Typeahead> dir


      Directory: C:\Users\simon\Documents\1. AURELIA\CLI\PROJECTS\Typeahead


  Mode                LastWriteTime         Length Name
  ----                -------------         ------ ----
  d-----       27/03/2018   1:58 PM                .vscode
  d-----       27/03/2018   1:58 PM                aurelia_project
  d-----       27/03/2018   1:58 PM                custom_typings
  d-----       27/03/2018   1:58 PM                dist
  d-----       27/03/2018   1:59 PM                node_modules
  d-----       27/03/2018   1:58 PM                src
  d-----       27/03/2018   1:58 PM                static
  d-----       27/03/2018   1:58 PM                test
  -a----       27/03/2018   1:58 PM            257 .editorconfig
  -a----       27/03/2018   1:58 PM            949 .gitignore
  -a----       27/03/2018   1:58 PM          24780 favicon.ico
  -a----       27/03/2018   1:58 PM            551 index.ejs
  -a----       27/03/2018   1:58 PM           2300 package-scripts.js
  -a----       27/03/2018   1:58 PM           2965 package.json
  -a----       27/03/2018   1:58 PM            569 tsconfig.json
  -a----       27/03/2018   1:58 PM             22 tslint.json
  -a----       27/03/2018   1:58 PM           4514 webpack.config.js
  -a----       27/03/2018   1:59 PM         420552 yarn.lock


  PS C:\Users\simon\Documents\1. AURELIA\CLI\PROJECTS\Typeahead> au build
  Starting 'clearDist'...
  Finished 'clearDist'
  Starting 'configureEnvironment'...
  Finished 'configureEnvironment'
  Starting 'buildWebpack'...
  (node:8080) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
  Finished 'buildWebpack'
  Hash: 51aab176119e9c7a12cf
  Version: webpack 4.2.0
  Time: 5455ms
  Built at: 2018-3-27 13:59:39
                                  Asset       Size  Chunks                    Chunk Names
    app.51aab176119e9c7a12cf.bundle.js   2.35 MiB     app  [emitted]  [big]  app
  vendor.51aab176119e9c7a12cf.bundle.js    489 KiB  vendor  [emitted]  [big]  vendor
                            index.html  589 bytes          [emitted]
  Entrypoint app [big] = app.51aab176119e9c7a12cf.bundle.js
  Entrypoint vendor [big] = vendor.51aab176119e9c7a12cf.bundle.js
  [./node_modules/aurelia-bootstrapper/dist/native-modules/aurelia-bootstrapper.js] 5.17 KiB {app} [built]
  [./node_modules/aurelia-loader-webpack/dist/native-modules/aurelia-loader-webpack.js] 14.4 KiB {app} [built]
  [./node_modules/aurelia-pal/dist/native-modules/aurelia-pal.js] 2.18 KiB {app} [built]
  [./node_modules/aurelia-polyfills/dist/native-modules/aurelia-polyfills.js] 24.4 KiB {app} [built]
  [./node_modules/aurelia-webpack-plugin/runtime/empty-entry.js] 585 bytes {app} [built]
  [./node_modules/aurelia-webpack-plugin/runtime/pal-loader-entry.js] 1.56 KiB {app} [built]
  [./node_modules/bluebird/js/browser/bluebird.js] 175 KiB {vendor} {app} [built]
  [./node_modules/bluebird/js/browser/bluebird.js-exposed] 65 bytes {vendor} {app} [built]
  [./node_modules/process/browser.js] 5.29 KiB {vendor} {app} [built]
  [./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 509 bytes {vendor} {app} [built]
  [aurelia-framework] ./node_modules/aurelia-framework/dist/native-modules/aurelia-framework.js 13.8 KiB {app} [built]
  [aurelia-pal-browser] ./node_modules/aurelia-pal-browser/dist/native-modules/aurelia-pal-browser.js 16.9 KiB {app} [built]
  [main] ./src/main.ts 1.09 KiB {app} [built]
    [0] multi aurelia-webpack-plugin/runtime/empty-entry aurelia-webpack-plugin/runtime/pal-loader-entry aurelia-bootstrapper 52 bytes {app} [built]
    [1] multi bluebird 28 bytes {vendor} [built]
      + 65 hidden modules

  ERROR in C:\Users\simon\Documents\1. AURELIA\CLI\PROJECTS\Typeahead\test\jest-pretest.ts
  [tsl] ERROR in C:\Users\simon\Documents\1. AURELIA\CLI\PROJECTS\Typeahead\test\jest-pretest.ts(3,9)
        TS2305: Module '"C:/Users/simon/Documents/1. AURELIA/CLI/PROJECTS/Typeahead/node_modules/aurelia-pal-nodejs/dist/index"' has no exported member 'globalize'.
  Child html-webpack-plugin for "index.html":
          Asset      Size  Chunks  Chunk Names
      index.html  1.36 MiB       0
      Entrypoint undefined = index.html
      [./node_modules/html-webpack-plugin/lib/loader.js!./index.ejs] 1.03 KiB {0} [built]
      [./node_modules/lodash/lodash.js] 527 KiB {0} [built]
      [./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 509 bytes {0} [built]
      [./node_modules/webpack/buildin/module.js] (webpack)/buildin/module.js 519 bytes {0} [built]
  PS C:\Users\simon\Documents\1. AURELIA\CLI\PROJECTS\Typeahead>

I am Mac user. But I saw this yesterday when testing something on a Windows PC, running nodejs 8.9.4.

Cli just never returns from “Happy Coding!”. So I shut the terminal off. The project files are all good though.

I was using GIT bash too.

Cant seem to run or build it either… errors.

Can you try npm install or yarn in the project folder before try au run/build?
As long as files are intact, it should recover.

Nvm, it looks you tried yarn.

You can try create a github issue on https://github.com/aurelia/cli

What version of CLI?

Actually it starts to look that way that It would be easier to get to you and show you. (-:
Where are you?

Australia :frowning:

Just downloaded as it suggested using bash… so I suspect the latest version.

I will eventually get this.

I have loaded my entire project up to GIT at si2030. If you can get that going it will show you the issue I have with the address custom template. Let me know if you decide to look in that direction.

@Alexander-Taran I am quite sure this is a cli bug on Windows. All I did was npm i -g aurelia-cil, then au new something, and I saw that @si2030 described.

But I am not the right person to investigate since I am not a Windows user. Not sure whether Git bash shell had some effect on this.

I got the same issue both with bash and powershell. I thought I would make sure it was not just one thing…

Created an issue for further investigation.
https://github.com/aurelia/cli/issues/859

I’ll get to it… not today though

I have read the discussion this morning on the issues with the CLI. I have used the command prompt to get the cli to work however I still get an error in the console. Any idea why and how to get rid of it?

    webpack - dev - server.js:1 C: \Users\simon\Documents\1. AURELIA\CLI\PROJECTS\Typeahead\test\jest - pretest.ts
    [tsl] ERROR in C:\Users\simon\Documents\1. AURELIA\CLI\PROJECTS\Typeahead\test\jest - pretest.ts(3, 9)
    TS2305: Module '"C:/Users/simon/Documents/1. AURELIA/CLI/PROJECTS/Typeahead/node_modules/aurelia-pal-nodejs/dist/index"' has no exported member 'globalize'.

@si2030, according the info in the issue. That is a separate Webpack4 issue, you need to manually update your package.json to force using webpack3.

Im not sure how to do that. Can you point me in the right direction of possible.

Looks like webpack 4.1.1 is enough to fix it.
Find “webpack”: “^4.2.x”, change it to “webpack”: “^4.1.1”, remove your node_modules folder, package-lock.json or yarn.lock file. Then reinstall everything with npm i or yarn.

But I am not a webpack user, I might missed something. In case you have other issue, I believe @fkleuver would love to help.

Sadly I was already on 4.1.1

I did delete both the node-modules and the package lock file and re installed the node-modules folder… However I am still getting the same error.

in bash I am getting this readout… it serves and the project does run but it has that error.

    $ au run --watch
Starting 'configureEnvironment'...
Finished 'configureEnvironment'
Starting 'runWebpack'...
Project is running at http://localhost:8080
webpack output is served from /
Content not from webpack is served from C:\Users\simon\Documents\1. AURELIA\CLI\PROJECTS\Typeahead\dist
404s will fallback to /index.html
Finished 'runWebpack'
i 「wdm」: wait until bundle finished: /
× 「wdm」: Hash: 0f40a5fcd35bb397b4fc
Version: webpack 4.4.1
Time: 6857ms
Built at: 2018-3-30 14:05:20
                                Asset       Size  Chunks                    Chunk Names
  app.0f40a5fcd35bb397b4fc.bundle.js   3.35 MiB     app  [emitted]  [big]  app
vendor.0f40a5fcd35bb397b4fc.bundle.js    489 KiB  vendor  [emitted]  [big]  vendor
                          index.html  589 bytes          [emitted]
Entrypoint app [big] = app.0f40a5fcd35bb397b4fc.bundle.js
Entrypoint vendor [big] = vendor.0f40a5fcd35bb397b4fc.bundle.js
[./node_modules/aurelia-bootstrapper/dist/native-modules/aurelia-bootstrapper.js] 5.17 KiB {app} [built]
[./node_modules/aurelia-loader-webpack/dist/native-modules/aurelia-loader-webpack.js] 14.4 KiB {app} [built]
[./node_modules/aurelia-pal/dist/native-modules/aurelia-pal.js] 2.18 KiB {app} [built]
[./node_modules/aurelia-polyfills/dist/native-modules/aurelia-polyfills.js] 24.4 KiB {app} [built]
[./node_modules/aurelia-webpack-plugin/runtime/empty-entry.js] 585 bytes {app} [built]
[./node_modules/aurelia-webpack-plugin/runtime/pal-loader-entry.js] 1.56 KiB {app} [built]
[./node_modules/bluebird/js/browser/bluebird.js] 175 KiB {vendor} {app} [built]
[./node_modules/bluebird/js/browser/bluebird.js-exposed] 65 bytes {vendor} {app} [built]
[./node_modules/process/browser.js] 5.29 KiB {vendor} {app} [built]
[./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 509 bytes {vendor} {app} [built]
[aurelia-framework] ./node_modules/aurelia-framework/dist/native-modules/aurelia-framework.js 14 KiB {app} [built]
[aurelia-pal-browser] ./node_modules/aurelia-pal-browser/dist/native-modules/aurelia-pal-browser.js 16.9 KiB {app} [built]
[main] ./src/main.ts 1.17 KiB {app} [built]
  [0] multi aurelia-webpack-plugin/runtime/empty-entry aurelia-webpack-plugin/runtime/pal-loader-entry aurelia-webpack-plugin/runtime/empty-entry aurelia-webpack-plugin/runtime/pal-loader-entry aurelia-bootstrapper 76 bytes {app} [built]
  [1] multi bluebird 28 bytes {vendor} [built]
    + 93 hidden modules

ERROR in C:\Users\simon\Documents\1. AURELIA\CLI\PROJECTS\Typeahead\test\jest-pretest.ts
[tsl] ERROR in C:\Users\simon\Documents\1. AURELIA\CLI\PROJECTS\Typeahead\test\jest-pretest.ts(3,9)
      TS2305: Module '"C:/Users/simon/Documents/1. AURELIA/CLI/PROJECTS/Typeahead/node_modules/aurelia-pal-nodejs/dist/index"' has no exported member 'globalize'.
Child html-webpack-plugin for "index.html":
        Asset      Size  Chunks  Chunk Names
    index.html  1.36 MiB       0
    Entrypoint undefined = index.html
    [./node_modules/html-webpack-plugin/lib/loader.js!./index.ejs] 1.03 KiB {0} [built]
    [./node_modules/lodash/lodash.js] 527 KiB {0} [built]
    [./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 509 bytes {0} [built]
    [./node_modules/webpack/buildin/module.js] (webpack)/buildin/module.js 519 bytes {0} [built]
i 「wdm」: Failed to compile.

Here is my package .json - its pretty much vanilla with the exception of trying to add aurelia-bootstrap and fetch.

    {
  "name": "typeahead",
  "description": "An Aurelia client application.",
  "version": "0.1.0",
  "repository": {
    "type": "???",
    "url": "???"
  },
  "license": "MIT",
  "dependencies": {
    "aurelia-bootstrapper": "^2.2.0",
    "aurelia-animator-css": "^1.0.4",
    "bluebird": "^3.5.1",
    "aurelia-polyfills": "^1.3.0",
    "aurelia-bootstrap": "^0.1.20",
    "aurelia-fetch-client": "^1.3.1",
    "bootstrap": "^3.3.7",
    "fetch": "^1.1.0",
    "isomorphic-fetch": "^2.2.1"
  },
  "peerDependencies": {},
  "devDependencies": {
    "aurelia-cli": "^0.33.0",
    "aurelia-testing": "^1.0.0-beta.4.0.0",
    "aurelia-tools": "^2.0.0",
    "gulp": "github:gulpjs/gulp#4.0",
    "minimatch": "^3.0.4",
    "through2": "^2.0.3",
    "uglify-js": "^3.3.15",
    "vinyl-fs": "^3.0.2",
    "ts-loader": "^4.0.1",
    "ts-node": "^5.0.1",
    "@types/node": "^9.4.7",
    "@types/lodash": "^4.14.105",
    "@types/webpack": "^4.1.1",
    "typescript": "^2.7.2",
    "jest": "^22.4.2",
    "jest-cli": "^23.0.0-alpha.0",
    "gulp-util": "^3.0.8",
    "aurelia-loader-nodejs": "^1.0.1",
    "aurelia-pal-nodejs": "^1.0.0-beta.3.2.0",
    "ts-jest": "^22.4.1",
    "@types/jest": "^22.2.0",
    "jasmine-core": "^3.1.0",
    "karma": "^2.0.0",
    "karma-chrome-launcher": "^2.2.0",
    "karma-coverage": "latest",
    "karma-jasmine": "^1.1.1",
    "karma-mocha-reporter": "latest",
    "karma-webpack": "latest",
    "karma-coverage-istanbul-reporter": "^1.4.2",
    "jest-jasmine2": "^23.0.0-alpha.0",
    "jest-matchers": "^20.0.3",
    "karma-typescript-preprocessor": "^0.3.1",
    "gulp-rename": "^1.2.2",
    "html-webpack-plugin": "^3.0.6",
    "copy-webpack-plugin": "^4.5.1",
    "extract-text-webpack-plugin": "next",
    "aurelia-webpack-plugin": "^3.0.0-rc.1",
    "webpack": "^4.1.1",
    "webpack-cli": "^2.0.12",
    "webpack-dev-server": "^3.1.1",
    "expose-loader": "^0.7.5",
    "style-loader": "^0.20.3",
    "url-loader": "^1.0.1",
    "del": "^3.0.0",
    "css-loader": "^0.28.11",
    "nps": "^5.8.2",
    "nps-utils": "^1.5.0",
    "file-loader": "^1.1.11",
    "json-loader": "^0.5.7",
    "html-loader": "^0.5.5",
    "istanbul-instrumenter-loader": "^3.0.0",
    "opn": "^5.3.0",
    "webpack-bundle-analyzer": "latest"
  },
  "jest": {
    "modulePaths": ["<rootDir>/src", "<rootDir>/node_modules"],
    "moduleFileExtensions": ["js", "json", "ts"],
    "transform": {
      "^.+\\.(ts|tsx)$": "<rootDir>/node_modules/ts-jest/preprocessor.js"
    },
    "testRegex": "\\.spec\\.(ts|js)x?$",
    "setupFiles": ["<rootDir>/test/jest-pretest.ts"],
    "testEnvironment": "node",
    "collectCoverage": true,
    "collectCoverageFrom": [
      "src/**/*.{js,ts}",
      "!**/*.spec.{js,ts}",
      "!**/node_modules/**",
      "!**/test/**"
    ],
    "coverageDirectory": "<rootDir>/test/coverage-jest",
    "coverageReporters": ["json", "lcov", "text", "html"]
  },
  "engines": {
    "node": ">= 6.0.0"
  },
  "scripts": {
    "start": "nps",
    "test": "nps test"
  },
  "main": "dist/app.bundle.js"
}

Not sure, maybe you can try “webpack”: “4.1.1” to force it.

Ok so I did amend this to so it forced webpack to be 4.1.1 and unfortunately I am still getting the same error. :frowning:

Seriously?
It was discussed in great detail @ issue https://github.com/aurelia/cli/issues/859
It is git-bash issue

Alex, he is talking about au run, which is unlikely git bash issue.