aurelia-dialog error with the release version and CLI
Asked Answered
C

3

5

I'm facing a problem when using the new aurelai release :

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

au run --watch

I get htis error :

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

Any idea ?

Curzon answered 4/8, 2016 at 8:24 Comment(0)
V
10

The reason this is happening 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.json file from

"dependencies": [
    "aurelia-dialog"
]

to

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

and that should solve your problem.

Vic answered 9/8, 2016 at 0:18 Comment(0)
T
2

I got into the same issue. I have installed the aurelia dialog using below npm command

npm install aurelia-dialog --save 

then just adding below dependencies to aurelia.json, resolved the issue

  {
    "name": "aurelia-dialog",
    "path": "../node_modules/aurelia-dialog/dist/amd",
    "main": "aurelia-dialog"
  }
Tjader answered 14/12, 2016 at 20:34 Comment(0)
U
0

Things have changed a little bit since the release of aurelia-dialog 2.0.0.

The block you need to add in the aurelia.json dependencies definition is now the following one:

"dependencies": [
    {
        "name": "aurelia-dialog",
        "path": "../node_modules/aurelia-dialog/dist/amd",
        "main": "aurelia-dialog",
        "resources": ["**/*.js"]
    }
]
Unconformity answered 5/3, 2020 at 13:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.