Aurelia-dialog error with release version and CLI

I had a problem using the new version of aurelai:

  • I created a new application using: au new myApp
  • I installed aurelia-dialog via npm
  • When I import the aurelia dialog and try to start the application using

au run --watch

I get htis error:

[Error: ENOENT: there is no such file or directory, open "C: \ src \ ai-dialog.js"]

Any idea?

+4
source share
2 answers

The reason this happens is because the package is a CommonJS package.

See: http://aurelia.io/hub.html#/doc/article/aurelia/framework/latest/the-aurelia-cli/10

Edit your aurelia_project/aurelia.jsonfile from

"dependencies": [
    "aurelia-dialog"
]

to

"dependencies": [
    {
        "name": "aurelia-dialog",
        "path": "../node_modules/aurelia-dialog/dist/amd",
        "main": "aurelia-dialog"
    }
]

.

+10

. aurelia, npm

npm install aurelia-dialog --save 

aurelia.json,

  {
    "name": "aurelia-dialog",
    "path": "../node_modules/aurelia-dialog/dist/amd",
    "main": "aurelia-dialog"
  }
+1

Source: https://habr.com/ru/post/1650137/


All Articles