2017-08-16 98 views
0

我已經通過au install apollo-client加入阿波羅客戶端找不到文件或訪問,現在當我運行au build我得到了一堆「找不到文件」消息:AU構建抱怨

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... 

任何想法,這是爲什麼發生了什麼?

回答

2

是的,這是目前仍然與我們的CLI對接的真正痛苦之一。如果您安裝的依賴項本身具有依賴性,則必須確保更新aurelia.json文件以將vendor-bundle中的所有這些依賴項也包含在內。 CLI團隊意識到這個問題並正在努力解決這個難題。

他們意識到這一點,因爲我對此抱怨不斷。我很善於抱怨。

UPDATE 2018年1月18日

的CLI現在有au install將安裝的依賴性,然後嘗試正確設置它在你的aurelia.json文件。

當使用CLI創建新項目時,您可以切換到使用Webpack作爲模塊加載器/打包程序,從而完全避免這些問題。你將不得不選擇創建一個「自定義」版本,但最近我已經移除了,我不得不說使用Aurelia CLI時的Webpack體驗相當不錯。