cli: au run fails when the app wasn't generated by that PC.

I’m submitting a bug report

  • Library Version: major

Please tell us about your environment:

  • Operating System: Windows [10]
  • Node Version: 4.4.7
  • NPM Version: 3.8.9
  • Language: ESNext

Current behavior: When uploading a repo to GitHub, I ignore node_modules as usual. When pulling the project, followed by: npm install && au run It will lead with an error and won’t run. The only way I found to get the app to work is by using au new to generate a new project and then replacing the SRC files…

  • What is the expected behavior? To run
  • What is the motivation / use case for changing the behavior? logic

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 46 (13 by maintainers)

Most upvoted comments

@EisenbergEffect People are still running into issues here so i think this should be re-oppened. The NPM issue was fixed by the latest NPM. However moving from Ubuntu -> Windows, Mac -> Windows or the opposite causes issues. As seen above.

This is mainly caused by aurelia.json’s not being able to read ‘/’ in windows, and ’ \ \ ’ in Mac/Linux.

@jaeko44 I’m afraid it didn’t work:

  • I’m on npm 3.10.6,
  • did (once again) a ‘npm install’,
  • replaced in aurelia.json all occurences of ‘/’ (Mac) with ‘\’ (Win)

and I still get exactly the same errors. Am I doing something wrong? Is there any other idea?

Meantime, I’ll try next to install in a clean directory to see if that will make any difference.

[later]

Yes, a clean installation worked! So here’s a possible checklist of things currently necessary when moving from Mac to Win:

  • latest npm (i.e. npm install -g npm)
  • latest aurelia-cli (i.e. npm install aurelia-cli -g). In my case this failed for some reason so I had to remove the directory manually and re-install).
  • latest app source files in a clean directory
  • replace in aurelia_project/aurelia.json all occurences of ‘/’ (Mac) with ‘\’ (Win) as suggested by @jaeko44 above

Things noted:

  1. It doesn’t need to be a different machine for it to fail a cloned deployment.
  2. The node_modules folder is much larger in the failed deployment.
    • Working proj DIR node_modules size = 90.1MB
    • Failed delpoyment DIR node_modules size = 264MB
  3. The error - Error
  4. Trying to manually install ‘aurelia-binding’ leads to additional dependencies that are in the aurelia_project/aurelia.json dependency list.
  5. Installing all the dependencies using --save will lead to an error (as I tried earlier, don’t have the error now unless I try again).
  6. Running ‘au new’ and then copying the node_modules folder from the new generated application and replacing it with the failed deployment will fix the project and it can then be run again.

Pull this project down on you computer (Step 4).

  1. On my windows machine I created a new project using aurelia-cli 0.17.0. a. au new -> name: au-test -> 1 -> enter -> enter
  2. Run the app with au run --env dev --watch a. App works. I can see welcome at http://localhost:9000
  3. Uploaded to github
  4. Cloned on mac a. git clone git@github.com:TylerJPresley/au-test.git b. npm install c. au run --env dev --watch d. opened http://localhost:9000
  5. ERROR: a. main.js:1 Uncaught SyntaxError: Unexpected token import b. vendor-bundle.js:11052 Uncaught TypeError: Cannot read property ‘__useDefault’ of undefined

Link to that line: https://github.com/TylerJPresley/au-test/blob/master/scripts/vendor-bundle.js#L11052