aurelia-dialog error with the release version and CLI

烂漫一生 提交于 2019-12-10 14:48:30

问题


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 ?


回答1:


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.




回答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"
  }


来源:https://stackoverflow.com/questions/38762135/aurelia-dialog-error-with-the-release-version-and-cli

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!