使用 feathers-authentication-client 时出现 Aurelia 依赖问题
Aurelia dependencies issue when using feathers-authentication-client
我将 npm 包添加到我的 aurelia.json 文件
{
"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
等的依赖等等
感谢@AshleyGrant 对此提供的帮助。解决方法如下:
确保在 aurelia.json
文件的 dependencies
下有这个
{
"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"]
}
我将 npm 包添加到我的 aurelia.json 文件
{
"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
等的依赖等等
感谢@AshleyGrant 对此提供的帮助。解决方法如下:
确保在
aurelia.json
文件的dependencies
下有这个{ "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"] }