我在我的aurelia.json文件中添加了一个npm包
{
"name": "feathers-authentication-client",
"path": "../node_modules/feathers-authentication-client/lib",
"main": "index"
}
然后我导入它
import * as auth from 'feathers-authentication-client';
但我一直收到这个错误:
{ Error: ENOENT: no such file or directory, open 'C:\path\to\project-folder\src\feathers-errors.js' ...
如果我也将此包添加到aurelia.json,那么我会得到相同的错误,但是依赖于feathers-errors
等等。
答案 0 :(得分:2)
确保您在dependencies
文件
aurelia.json
下有此内容
{
"name": "feathers-client",
"path": "../node_modules/feathers-client/dist",
"main": "feathers"
},
{
"name": "feathers-authentication-client",
"main": "lib/index",
"path": "../node_modules/feathers-authentication-client",
"resources": []
},
"feathers-errors",
"ms",
{
"name": "debug",
"main": "browser",
"path": "../node_modules/debug"
},
{
"name": "jwt-decode",
"main": "index",
"path": "../node_modules/jwt-decode/lib",
"resources": ["base64_url_decode.js", "atob.js"]
}