2017-05-26 120 views
1

使用Polymer CLI 1.1.0運行在我的項目的根主任polymer build後,我得到這個錯誤:爲什麼「polymer build」會拋出錯誤「File not found with singular glob」?

info: Clearing build/ directory... 
error: Uncaught exception: Error: File not found with singular glob: /home/willie/Projects/World History Final Project/src/passport-app/passport-app.html 
error: Error: File not found with singular glob: /home/willie/Projects/World History Final Project/src/passport-app/passport-app.html 
    at Glob.<anonymous> (/usr/lib/node_modules/polymer-cli/node_modules/glob-stream/index.js:41:11) 
    at Glob.g (events.js:292:16) 
    at emitOne (events.js:96:13) 
    at Glob.emit (events.js:188:7) 
    at Glob._finish (/usr/lib/node_modules/polymer-cli/node_modules/glob-stream/node_modules/glob/glob.js:172:8) 
    at done (/usr/lib/node_modules/polymer-cli/node_modules/glob-stream/node_modules/glob/glob.js:159:12) 
    at Glob._processSimple2 (/usr/lib/node_modules/polymer-cli/node_modules/glob-stream/node_modules/glob/glob.js:652:12) 
    at /usr/lib/node_modules/polymer-cli/node_modules/glob-stream/node_modules/glob/glob.js:640:10 
    at Glob._stat2 (/usr/lib/node_modules/polymer-cli/node_modules/glob-stream/node_modules/glob/glob.js:736:12) 
    at lstatcb_ (/usr/lib/node_modules/polymer-cli/node_modules/glob-stream/node_modules/glob/glob.js:728:12) 

我想知道爲什麼會持續發生。

回答

2

Polymer CLI旨在使用REPL app shell architecture構建應用程序。在您的polymer.json文件中,您必須定義任何「延遲加載的片段」。將碎片添加到文件後,在包含配置文件的目錄中運行polymer build

{ 
    "entrypoint": "index.html", 
    "shell": "src/passport-app.html", 
    "fragments": [ 
    //This is where you messed up. 
    "src/passport-home.html", 
    "src/passport-introduction.html", 
    "src/passport-404.html", 
    "src/passport-economy.html", 
    "src/passport-news.html", 
    "src/passport-immigration.html", 
    "src/passport-culture.html" 
    ], 
    "sources": [ 
    "src/**/*", 
    "images/**/*", 
    "bower.json" 
    ], 
    "extraDependencies": [ 
    "manifest.json", 
    "bower_components/webcomponentsjs/*.js" 
    ], 
    "lint": { 
    "rules": [ 
     "polymer-2" 
    ] 
    }, 
    "builds": [ 
    { 
     "preset": "es6-bundled" 
    } 
    ] 
} 
+0

感謝'extraDependencies'。默認Polymer'includeDependencies'不起作用。 –

相關問題