Error with polymer build

2019-09-09 22:33发布

问题:

I am triying to learn how to use the new app-toolbox. In local, works fine; but when I use:

polymer build

I get these errors:

C:\Users\Marcos\Documents\poly2>polymer build info: Building application... info: Generating build/unbundled... info: Generating build/bundled... error: Uncaught exception: Error: file path is not in root: C:/Users/Marcos/Documents/poly2/index.html (C:\Users\Marcos\Documents\poly2) error: Error: file path is not in root: C:/Users/Marcos/Documents/poly2/index.html (C:\Users\Marcos\Documents\poly2) at StreamAnalyzer.urlFromPath (C:\Users\Marcos\AppData\Roaming\npm\node_modules\polymer-cli\lib\build\analyzer.js:91:19) at StreamAnalyzer.addFile (C:\Users\Marcos\AppData\Roaming\npm\node_modules\polymer-cli\lib\build\analyzer.js:81:29) at StreamAnalyzer._transform (C:\Users\Marcos\AppData\Roaming\npm\node_modules\polymer-cli\lib\build\analyzer.js:48:14) at StreamAnalyzer.Transform._read (_stream_transform.js:167:10) at StreamAnalyzer.Transform._write (_stream_transform.js:155:12) at doWrite (_stream_writable.js:301:12) at writeOrBuffer (_stream_writable.js:287:5) at StreamAnalyzer.Writable.write (_stream_writable.js:215:11) at PassThrough.ondata (C:\Users\Marcos\AppData\Roaming\npm\node_modules\polymer-cli\node_modules\readable-stream\lib_stream_readable.js:531:20) at emitOne (events.js:95:20)

I am using Windows 10.

回答1:

I got the same problem. Deleting npm-cache at C:\Users\%USER_NAME%\AppData\Roaming\npm-cache and re-installing nodejs and polymer-cli fixed this for me. Currently, I'm using Windows 10 with nodejs v4.4.5, npm v2.15.5 and polymer-cli v0.11.0 (I notice that they've just updated polymer-cli from v0.10.0 to v0.11.0)

Hope this help.