在 Aurelia 项目中集成 Discogs disconnect node 模块
Integrating Discogs disconnect node module in Aurelia project
我正在使用 aurelia.io,我想在我的应用程序中使用 "disconnect" npm 包来处理 Discogs API。
我正常安装它,在我的应用程序的文件夹中键入 npm install disconnect --save
。
我还正确编辑 aurelia.json
以插入 vendor-bundle.js
部分:
{
"name": "disconnect",
"path": "../node_modules/disconnect",
"main": "index"
},
然后我输入 au build
构建我的应用程序,但我收到此错误:
{ uid: 8,
name: 'writeBundles',
branch: false,
error:
{ Error: ENOENT: no such file or directory, open '/home/cesar/projets/aurelia/tracklist-manager/disconnect/lib/util.js'
at Object.fs.openSync (fs.js:558:18)
at Object.fs.readFileSync (fs.js:468:33)
at Object.exports.readFileSync (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/file-system.js:49:13)
at fileRead (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/build/bundled-source.js:83:31)
at Object.context.fileRead (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:176:18)
at Object.context.load (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:357:30)
at Module.load (eval at <anonymous> (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:14:1), <anonymous>:832:29)
at Module.fetch (eval at <anonymous> (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:14:1), <anonymous>:822:66)
at Module.check (eval at <anonymous> (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:14:1), <anonymous>:854:30)
at Module.enable (eval at <anonymous> (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:14:1), <anonymous>:1173:22)
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '/home/cesar/projets/aurelia/tracklist-manager/disconnect/lib/util.js',
moduleTree: [ 'disconnect/index' ],
fileName: '/home/cesar/projets/aurelia/tracklist-manager/node_modules/disconnect/index.js' },
duration: [ 4, 789092986 ],
time: 1490043332523 }
{ uid: 0,
name: '<series>',
branch: true,
error:
{ Error: ENOENT: no such file or directory, open '/home/cesar/projets/aurelia/tracklist-manager/disconnect/lib/util.js'
at Object.fs.openSync (fs.js:558:18)
at Object.fs.readFileSync (fs.js:468:33)
at Object.exports.readFileSync (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/file-system.js:49:13)
at fileRead (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/build/bundled-source.js:83:31)
at Object.context.fileRead (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:176:18)
at Object.context.load (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:357:30)
at Module.load (eval at <anonymous> (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:14:1), <anonymous>:832:29)
at Module.fetch (eval at <anonymous> (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:14:1), <anonymous>:822:66)
at Module.check (eval at <anonymous> (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:14:1), <anonymous>:854:30)
at Module.enable (eval at <anonymous> (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:14:1), <anonymous>:1173:22)
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '/home/cesar/projets/aurelia/tracklist-manager/disconnect/lib/util.js',
moduleTree: [ 'disconnect/index' ],
fileName: '/home/cesar/projets/aurelia/tracklist-manager/node_modules/disconnect/index.js' },
duration: [ 8, 704096699 ],
time: 1490043332559 }
{ Error: ENOENT: no such file or directory, open '/home/cesar/projets/aurelia/tracklist-manager/disconnect/lib/util.js'
at Object.fs.openSync (fs.js:558:18)
at Object.fs.readFileSync (fs.js:468:33)
at Object.exports.readFileSync (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/file-system.js:49:13)
at fileRead (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/build/bundled-source.js:83:31)
at Object.context.fileRead (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:176:18)
at Object.context.load (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:357:30)
at Module.load (eval at <anonymous> (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:14:1), <anonymous>:832:29)
at Module.fetch (eval at <anonymous> (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:14:1), <anonymous>:822:66)
at Module.check (eval at <anonymous> (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:14:1), <anonymous>:854:30)
at Module.enable (eval at <anonymous> (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:14:1), <anonymous>:1173:22)
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '/home/cesar/projets/aurelia/tracklist-manager/disconnect/lib/util.js',
moduleTree: [ 'disconnect/index' ],
fileName: '/home/cesar/projets/aurelia/tracklist-manager/node_modules/disconnect/index.js' }
我不知道怎么了...
如果你能帮助我,那就太好了:)
正如 Ashley 的回答中提到的,我的问题无法按照我想要的方式解决。
某些节点包仅适用于服务器而非浏览器...
我正在使用 aurelia.io,我想在我的应用程序中使用 "disconnect" npm 包来处理 Discogs API。
我正常安装它,在我的应用程序的文件夹中键入 npm install disconnect --save
。
我还正确编辑 aurelia.json
以插入 vendor-bundle.js
部分:
{
"name": "disconnect",
"path": "../node_modules/disconnect",
"main": "index"
},
然后我输入 au build
构建我的应用程序,但我收到此错误:
{ uid: 8,
name: 'writeBundles',
branch: false,
error:
{ Error: ENOENT: no such file or directory, open '/home/cesar/projets/aurelia/tracklist-manager/disconnect/lib/util.js'
at Object.fs.openSync (fs.js:558:18)
at Object.fs.readFileSync (fs.js:468:33)
at Object.exports.readFileSync (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/file-system.js:49:13)
at fileRead (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/build/bundled-source.js:83:31)
at Object.context.fileRead (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:176:18)
at Object.context.load (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:357:30)
at Module.load (eval at <anonymous> (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:14:1), <anonymous>:832:29)
at Module.fetch (eval at <anonymous> (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:14:1), <anonymous>:822:66)
at Module.check (eval at <anonymous> (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:14:1), <anonymous>:854:30)
at Module.enable (eval at <anonymous> (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:14:1), <anonymous>:1173:22)
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '/home/cesar/projets/aurelia/tracklist-manager/disconnect/lib/util.js',
moduleTree: [ 'disconnect/index' ],
fileName: '/home/cesar/projets/aurelia/tracklist-manager/node_modules/disconnect/index.js' },
duration: [ 4, 789092986 ],
time: 1490043332523 }
{ uid: 0,
name: '<series>',
branch: true,
error:
{ Error: ENOENT: no such file or directory, open '/home/cesar/projets/aurelia/tracklist-manager/disconnect/lib/util.js'
at Object.fs.openSync (fs.js:558:18)
at Object.fs.readFileSync (fs.js:468:33)
at Object.exports.readFileSync (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/file-system.js:49:13)
at fileRead (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/build/bundled-source.js:83:31)
at Object.context.fileRead (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:176:18)
at Object.context.load (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:357:30)
at Module.load (eval at <anonymous> (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:14:1), <anonymous>:832:29)
at Module.fetch (eval at <anonymous> (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:14:1), <anonymous>:822:66)
at Module.check (eval at <anonymous> (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:14:1), <anonymous>:854:30)
at Module.enable (eval at <anonymous> (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:14:1), <anonymous>:1173:22)
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '/home/cesar/projets/aurelia/tracklist-manager/disconnect/lib/util.js',
moduleTree: [ 'disconnect/index' ],
fileName: '/home/cesar/projets/aurelia/tracklist-manager/node_modules/disconnect/index.js' },
duration: [ 8, 704096699 ],
time: 1490043332559 }
{ Error: ENOENT: no such file or directory, open '/home/cesar/projets/aurelia/tracklist-manager/disconnect/lib/util.js'
at Object.fs.openSync (fs.js:558:18)
at Object.fs.readFileSync (fs.js:468:33)
at Object.exports.readFileSync (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/file-system.js:49:13)
at fileRead (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/build/bundled-source.js:83:31)
at Object.context.fileRead (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:176:18)
at Object.context.load (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:357:30)
at Module.load (eval at <anonymous> (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:14:1), <anonymous>:832:29)
at Module.fetch (eval at <anonymous> (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:14:1), <anonymous>:822:66)
at Module.check (eval at <anonymous> (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:14:1), <anonymous>:854:30)
at Module.enable (eval at <anonymous> (/home/cesar/projets/aurelia/tracklist-manager/node_modules/aurelia-cli/lib/build/amodro-trace/lib/loader/Loader.js:14:1), <anonymous>:1173:22)
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '/home/cesar/projets/aurelia/tracklist-manager/disconnect/lib/util.js',
moduleTree: [ 'disconnect/index' ],
fileName: '/home/cesar/projets/aurelia/tracklist-manager/node_modules/disconnect/index.js' }
我不知道怎么了... 如果你能帮助我,那就太好了:)
正如 Ashley 的回答中提到的,我的问题无法按照我想要的方式解决。 某些节点包仅适用于服务器而非浏览器...