npm run build:js在Jupyter笔记本代码上抛出错误

时间:2016-09-28 05:21:03

标签: npm babeljs jupyter jupyter-notebook babel

我刚刚使用了Jupyter Notebook原始代码,对HTML / Javascript进行了一些小改动,并尝试重新构建它。它抛出了以下错误:

WARNING in ./~/xterm/addons/attach/index.html
Module parse failed: C:\Users\ytayal\Downloads\notebook-master\node_modules\xterm\addons\attach\index.html Unexpected token (1:0)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (1:0)
    at Parser.pp$4.raise (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:2221:15)
    at Parser.pp.unexpected (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:603:10)
    at Parser.pp$3.parseExprAtom (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:1822:12)
    at Parser.pp$3.parseExprSubscripts (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:1715:21)
    at Parser.pp$3.parseMaybeUnary (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:1692:19)
    at Parser.pp$3.parseExprOps (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:1637:21)
    at Parser.pp$3.parseMaybeConditional (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:1620:21)
    at Parser.pp$3.parseMaybeAssign (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:1597:21)
    at Parser.pp$3.parseExpression (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:1573:21)
    at Parser.pp$1.parseStatement (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:727:47)
    at Parser.pp$1.parseTopLevel (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:638:25)
    at Parser.parse (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:516:17)
    at Object.parse (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:3098:39)
    at Parser.parse (C:\Users\ytayal\Downloads\notebook-master\node_modules\webpack\lib\Parser.js:902:15)
    at DependenciesBlock.<anonymous> (C:\Users\ytayal\Downloads\notebook-master\node_modules\webpack\lib\NormalModule.js:104:16)
    at DependenciesBlock.onModuleBuild (C:\Users\ytayal\Downloads\notebook-master\node_modules\webpack-core\lib\NormalModuleMixin.js:310:10)
    at nextLoader (C:\Users\ytayal\Downloads\notebook-master\node_modules\webpack-core\lib\NormalModuleMixin.js:275:25)
    at C:\Users\ytayal\Downloads\notebook-master\node_modules\webpack-core\lib\NormalModuleMixin.js:259:5
    at Storage.finished (C:\Users\ytayal\Downloads\notebook-master\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:38:16)
    at C:\Users\ytayal\Downloads\notebook-master\node_modules\graceful-fs\graceful-fs.js:78:16
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:380:3)
 @ ./~/xterm/addons ^\.\/.*$

WARNING in ./~/xterm/addons/linkify/index.html
Module parse failed: C:\Users\ytayal\Downloads\notebook-master\node_modules\xterm\addons\linkify\index.html Unexpected token (1:0)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (1:0)
    at Parser.pp$4.raise (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:2221:15)
    at Parser.pp.unexpected (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:603:10)
    at Parser.pp$3.parseExprAtom (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:1822:12)
    at Parser.pp$3.parseExprSubscripts (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:1715:21)
    at Parser.pp$3.parseMaybeUnary (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:1692:19)
    at Parser.pp$3.parseExprOps (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:1637:21)
    at Parser.pp$3.parseMaybeConditional (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:1620:21)
    at Parser.pp$3.parseMaybeAssign (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:1597:21)
    at Parser.pp$3.parseExpression (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:1573:21)
    at Parser.pp$1.parseStatement (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:727:47)
    at Parser.pp$1.parseTopLevel (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:638:25)
    at Parser.parse (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:516:17)
    at Object.parse (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:3098:39)
    at Parser.parse (C:\Users\ytayal\Downloads\notebook-master\node_modules\webpack\lib\Parser.js:902:15)
    at DependenciesBlock.<anonymous> (C:\Users\ytayal\Downloads\notebook-master\node_modules\webpack\lib\NormalModule.js:104:16)
    at DependenciesBlock.onModuleBuild (C:\Users\ytayal\Downloads\notebook-master\node_modules\webpack-core\lib\NormalModuleMixin.js:310:10)
    at nextLoader (C:\Users\ytayal\Downloads\notebook-master\node_modules\webpack-core\lib\NormalModuleMixin.js:275:25)
    at C:\Users\ytayal\Downloads\notebook-master\node_modules\webpack-core\lib\NormalModuleMixin.js:259:5
    at Storage.finished (C:\Users\ytayal\Downloads\notebook-master\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:38:16)
    at C:\Users\ytayal\Downloads\notebook-master\node_modules\graceful-fs\graceful-fs.js:78:16
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:380:3)
 @ ./~/xterm/addons ^\.\/.*$

WARNING in ./~/xterm/addons/attach/index.html
Module parse failed: C:\Users\ytayal\Downloads\notebook-master\node_modules\xterm\addons\attach\index.html Unexpected token (1:0)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (1:0)
    at Parser.pp$4.raise (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:2221:15)
    at Parser.pp.unexpected (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:603:10)
    at Parser.pp$3.parseExprAtom (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:1822:12)
    at Parser.pp$3.parseExprSubscripts (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:1715:21)
    at Parser.pp$3.parseMaybeUnary (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:1692:19)
    at Parser.pp$3.parseExprOps (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:1637:21)
    at Parser.pp$3.parseMaybeConditional (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:1620:21)
    at Parser.pp$3.parseMaybeAssign (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:1597:21)
    at Parser.pp$3.parseExpression (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:1573:21)
    at Parser.pp$1.parseStatement (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:727:47)
    at Parser.pp$1.parseTopLevel (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:638:25)
    at Parser.parse (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:516:17)
    at Object.parse (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:3098:39)
    at Parser.parse (C:\Users\ytayal\Downloads\notebook-master\node_modules\webpack\lib\Parser.js:902:15)
    at DependenciesBlock.<anonymous> (C:\Users\ytayal\Downloads\notebook-master\node_modules\webpack\lib\NormalModule.js:104:16)
    at DependenciesBlock.onModuleBuild (C:\Users\ytayal\Downloads\notebook-master\node_modules\webpack-core\lib\NormalModuleMixin.js:310:10)
    at nextLoader (C:\Users\ytayal\Downloads\notebook-master\node_modules\webpack-core\lib\NormalModuleMixin.js:275:25)
    at C:\Users\ytayal\Downloads\notebook-master\node_modules\webpack-core\lib\NormalModuleMixin.js:259:5
    at Storage.finished (C:\Users\ytayal\Downloads\notebook-master\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:38:16)
    at C:\Users\ytayal\Downloads\notebook-master\node_modules\graceful-fs\graceful-fs.js:78:16
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:380:3)
 @ ./~/xterm/addons ^\.\/.*$

WARNING in ./~/xterm/addons/linkify/index.html
Module parse failed: C:\Users\ytayal\Downloads\notebook-master\node_modules\xterm\addons\linkify\index.html Unexpected token (1:0)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (1:0)
    at Parser.pp$4.raise (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:2221:15)
    at Parser.pp.unexpected (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:603:10)
    at Parser.pp$3.parseExprAtom (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:1822:12)
    at Parser.pp$3.parseExprSubscripts (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:1715:21)
    at Parser.pp$3.parseMaybeUnary (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:1692:19)
    at Parser.pp$3.parseExprOps (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:1637:21)
    at Parser.pp$3.parseMaybeConditional (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:1620:21)
    at Parser.pp$3.parseMaybeAssign (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:1597:21)
    at Parser.pp$3.parseExpression (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:1573:21)
    at Parser.pp$1.parseStatement (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:727:47)
    at Parser.pp$1.parseTopLevel (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:638:25)
    at Parser.parse (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:516:17)
    at Object.parse (C:\Users\ytayal\Downloads\notebook-master\node_modules\acorn\dist\acorn.js:3098:39)
    at Parser.parse (C:\Users\ytayal\Downloads\notebook-master\node_modules\webpack\lib\Parser.js:902:15)
    at DependenciesBlock.<anonymous> (C:\Users\ytayal\Downloads\notebook-master\node_modules\webpack\lib\NormalModule.js:104:16)
    at DependenciesBlock.onModuleBuild (C:\Users\ytayal\Downloads\notebook-master\node_modules\webpack-core\lib\NormalModuleMixin.js:310:10)
    at nextLoader (C:\Users\ytayal\Downloads\notebook-master\node_modules\webpack-core\lib\NormalModuleMixin.js:275:25)
    at C:\Users\ytayal\Downloads\notebook-master\node_modules\webpack-core\lib\NormalModuleMixin.js:259:5
    at Storage.finished (C:\Users\ytayal\Downloads\notebook-master\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:38:16)
    at C:\Users\ytayal\Downloads\notebook-master\node_modules\graceful-fs\graceful-fs.js:78:16
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:380:3)
 @ ./~/xterm/addons ^\.\/.*$

1 个答案:

答案 0 :(得分:1)

对您可以尝试foreach (var archive in archives) { var filename = "archive-" + archive.Name + ".txt"; using (var log = new LoggerConfiguration() .WriteTo.File(filename) .CreateLogger()) { log.Information("Processing archive"); // etc. } } 的代码进行更改,然后使用python setup.py build运行jupyter。它会反映您的更改。

不确定为什么错误jupyter notebook