我已经通过au install apollo-client
添加了apollo-client,现在当我运行au build
时,我找不到一堆文件'消息:
Tracing apollo-client...
------- File not found or not accessible ------
| Location: /some/path/Client/src/whatwg-fetch.js
| Requested by: /some/path/Client/node_modules/apollo-client/apollo.umd.js
| Is this a package? Make sure that it is configured in aurelia.json and that it is not a Node.js package
-----------------------------------------------
------- File not found or not accessible ------
| Location: /some/path/Client/src/graphql/language/printer.js
| Requested by: /some/path/Client/node_modules/apollo-client/apollo.umd.js
| Is this a package? Make sure that it is configured in aurelia.json and that it is not a Node.js package
-----------------------------------------------
------- File not found or not accessible ------
| Location: /some/path/Client/src/redux.js
| Requested by: /some/path/Client/node_modules/apollo-client/apollo.umd.js
| Is this a package? Make sure that it is configured in aurelia.json and that it is not a Node.js package
-----------------------------------------------
------- File not found or not accessible ------
| Location: /some/path/Client/src/graphql-anywhere.js
| Requested by: /some/path/Client/node_modules/apollo-client/apollo.umd.js
| Is this a package? Make sure that it is configured in aurelia.json and that it is not a Node.js package
-----------------------------------------------
------- File not found or not accessible ------
| Location: /some/path/Client/src/symbol-observable.js
| Requested by: /some/path/Client/node_modules/apollo-client/apollo.umd.js
| Is this a package? Make sure that it is configured in aurelia.json and that it is not a Node.js package
-----------------------------------------------
------- File not found or not accessible ------
| Location: /some/path/Client/src/apollo-link-core.js
| Requested by: /some/path/Client/node_modules/apollo-client/apollo.umd.js
| Is this a package? Make sure that it is configured in aurelia.json and that it is not a Node.js package
-----------------------------------------------
------- File not found or not accessible ------
| Location: /some/path/Client/src/whatwg-fetch.js
| Requested by: /some/path/Client/node_modules/apollo-client/apollo.umd.js
| Is this a package? Make sure that it is configured in aurelia.json and that it is not a Node.js package
-----------------------------------------------
------- File not found or not accessible ------
| Location: /some/path/Client/src/graphql/language/printer.js
| Requested by: /some/path/Client/node_modules/apollo-client/apollo.umd.js
| Is this a package? Make sure that it is configured in aurelia.json and that it is not a Node.js package
-----------------------------------------------
------- File not found or not accessible ------
| Location: /some/path/Client/src/redux.js
| Requested by: /some/path/Client/node_modules/apollo-client/apollo.umd.js
| Is this a package? Make sure that it is configured in aurelia.json and that it is not a Node.js package
-----------------------------------------------
------- File not found or not accessible ------
| Location: /some/path/Client/src/graphql-anywhere.js
| Requested by: /some/path/Client/node_modules/apollo-client/apollo.umd.js
| Is this a package? Make sure that it is configured in aurelia.json and that it is not a Node.js package
-----------------------------------------------
------- File not found or not accessible ------
| Location: /some/path/Client/src/symbol-observable.js
| Requested by: /some/path/Client/node_modules/apollo-client/apollo.umd.js
| Is this a package? Make sure that it is configured in aurelia.json and that it is not a Node.js package
-----------------------------------------------
------- File not found or not accessible ------
| Location: /some/path/Client/src/apollo-link-core.js
| Requested by: /some/path/Client/node_modules/apollo-client/apollo.umd.js
| Is this a package? Make sure that it is configured in aurelia.json and that it is not a Node.js package
-----------------------------------------------
Tracing whatwg-fetch...
Tracing graphql/language/printer...
Tracing redux...
Tracing graphql-anywhere...
Tracing symbol-observable...
Tracing apollo-link-core...
Tracing core-js...
知道为什么会这样吗?
答案 0 :(得分:4)
是的,这是目前仍然是我们的CLI屁股真正的痛苦之一。如果您安装了一个本身具有依赖项的依赖项,则必须确保更新aurelia.json
文件以在vendor-bundle
中包含所有这些依赖项。 CLI团队意识到了这个问题,正在努力解决这个难点。
他们意识到这一点,因为我不断抱怨这一点。我很擅长抱怨。
更新2018-01-18
CLI现在有au install
,它将安装依赖项,然后尝试在aurelia.json
文件中正确设置它。
在使用CLI创建新项目时,切换到使用Webpack作为模块加载器/捆绑器,可以完全避免这些问题。你将不得不选择创建一个“自定义”版本,但我最近搬过来了,我不得不说使用Aurelia CLI时的Webpack体验非常好。