npm run build

来源:1-4 课程说明

低级前端开花工程师

2017-07-17

我是widows的

"build": "rd/s/q build && set NODE_ENV=production && webpack --config ./webpack.production.config.js --progress --colors" 改成这样子了 运行报错,我创建了build文件夹,但是运行一下又报错 下面是报错的代码,老师麻烦看看是什么问题


D:\BaiduNetdiskDownload\MY\React\Imooc\react-dianping>npm run build


> react-dianping-webpack@1.0.0 build D:\BaiduNetdiskDownload\MY\React\Imooc\reac

t-dianping

> rd/s/q build && set NODE_ENV=production && webpack --config ./webpack.producti

on.config.js --progress --colors


 66% 393/417 build modulesD:\BaiduNetdiskDownload\MY\React\Imooc\react-dianping\

node_modules\_webpack@1.15.0@webpack\lib\TemplatedPathPlugin.js:50

                        if(!allowEmpty) throw new Error("Path variable " + match

 + " not implemented in this context: " + input);

                                        ^


Error: Path variable [chunkhash:8] not implemented in this context: fonts/icomoo

n.[chunkhash:8].svg

    at D:\BaiduNetdiskDownload\MY\React\Imooc\react-dianping\node_modules\_webpa

ck@1.15.0@webpack\lib\TemplatedPathPlugin.js:50:26

    at D:\BaiduNetdiskDownload\MY\React\Imooc\react-dianping\node_modules\_webpa

ck@1.15.0@webpack\lib\TemplatedPathPlugin.js:40:23

    at RegExp.[Symbol.replace] (native)

    at RegExp.[Symbol.replace] (native)

    at String.replace (native)

    at Template.replacePathVariables (D:\BaiduNetdiskDownload\MY\React\Imooc\rea

ct-dianping\node_modules\_webpack@1.15.0@webpack\lib\TemplatedPathPlugin.js:71:4

)

    at Template.applyPlugins [as applyPluginsWaterfall] (D:\BaiduNetdiskDownload

\MY\React\Imooc\react-dianping\node_modules\_tapable@0.1.10@tapable\lib\Tapable.

js:37:47)

    at Compilation.getPath (D:\BaiduNetdiskDownload\MY\React\Imooc\react-dianpin

g\node_modules\_webpack@1.15.0@webpack\lib\Compilation.js:882:27)

    at Compilation.<anonymous> (D:\BaiduNetdiskDownload\MY\React\Imooc\react-dia

nping\node_modules\_webpack@1.15.0@webpack\lib\Compilation.js:821:21)

    at Array.forEach (native)

    at Compilation.createChunkAssets (D:\BaiduNetdiskDownload\MY\React\Imooc\rea

ct-dianping\node_modules\_webpack@1.15.0@webpack\lib\Compilation.js:820:31)

    at Compilation.<anonymous> (D:\BaiduNetdiskDownload\MY\React\Imooc\react-dia

nping\node_modules\_webpack@1.15.0@webpack\lib\Compilation.js:557:8)

    at Compilation.applyPluginsAsync (D:\BaiduNetdiskDownload\MY\React\Imooc\rea

ct-dianping\node_modules\_tapable@0.1.10@tapable\lib\Tapable.js:60:69)

    at Compilation.seal (D:\BaiduNetdiskDownload\MY\React\Imooc\react-dianping\n

ode_modules\_webpack@1.15.0@webpack\lib\Compilation.js:525:7)

    at Compiler.<anonymous> (D:\BaiduNetdiskDownload\MY\React\Imooc\react-dianpi

ng\node_modules\_webpack@1.15.0@webpack\lib\Compiler.js:397:15)

    at D:\BaiduNetdiskDownload\MY\React\Imooc\react-dianping\node_modules\_tapab

le@0.1.10@tapable\lib\Tapable.js:103:11

    at Compilation.<anonymous> (D:\BaiduNetdiskDownload\MY\React\Imooc\react-dia

nping\node_modules\_webpack@1.15.0@webpack\lib\Compilation.js:445:10)

    at D:\BaiduNetdiskDownload\MY\React\Imooc\react-dianping\node_modules\_webpa

ck@1.15.0@webpack\lib\Compilation.js:417:12

    at D:\BaiduNetdiskDownload\MY\React\Imooc\react-dianping\node_modules\_webpa

ck@1.15.0@webpack\lib\Compilation.js:332:10

    at D:\BaiduNetdiskDownload\MY\React\Imooc\react-dianping\node_modules\_async

@1.5.2@async\lib\async.js:52:16

    at done (D:\BaiduNetdiskDownload\MY\React\Imooc\react-dianping\node_modules\

_async@1.5.2@async\lib\async.js:246:17)

    at D:\BaiduNetdiskDownload\MY\React\Imooc\react-dianping\node_modules\_async

@1.5.2@async\lib\async.js:44:16

    at _combinedTickCallback (internal/process/next_tick.js:73:7)

    at process._tickCallback (internal/process/next_tick.js:104:9)


npm ERR! Windows_NT 6.1.7601

npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\

node_modules\\npm\\bin\\npm-cli.js" "run" "build"

npm ERR! node v6.10.3

npm ERR! npm  v3.10.10

npm ERR! code ELIFECYCLE

npm ERR! react-dianping-webpack@1.0.0 build: `rd/s/q build && set NODE_ENV=produ

ction && webpack --config ./webpack.production.config.js --progress --colors`

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the react-dianping-webpack@1.0.0 build script 'rd/s/q build &

& set NODE_ENV=production && webpack --config ./webpack.production.config.js --p

rogress --colors'.

npm ERR! Make sure you have the latest version of node.js and npm installed.

npm ERR! If you do, this is most likely a problem with the react-dianping-webpac

k package,

npm ERR! not with npm itself.

npm ERR! Tell the author that this fails on your system:

npm ERR!     rd/s/q build && set NODE_ENV=production && webpack --config ./webpa

ck.production.config.js --progress --colors

npm ERR! You can get information on how to open an issue for this project with:

npm ERR!     npm bugs react-dianping-webpack

npm ERR! Or if that isn't available, you can get their info via:

npm ERR!     npm owner ls react-dianping-webpack

npm ERR! There is likely additional logging output above.


npm ERR! Please include the following file with any support request:

npm ERR!     D:\BaiduNetdiskDownload\MY\React\Imooc\react-dianping\npm-debug.log


写回答

2回答

低级前端开花工程师

提问者

2017-07-18

这是删除rd/s/q build &&的报错 感觉好像一样的。

D:\BaiduNetdiskDownload\MY\React\Imooc\react-dianping>npm run build


> react-dianping-webpack@1.0.0 build D:\BaiduNetdiskDownload\MY\React\Imooc\reac

t-dianping

>  set NODE_ENV=production && webpack --config ./webpack.production.config.js --

progress --colors


 66% 394/418 build modulesD:\BaiduNetdiskDownload\MY\React\Imooc\react-dianping\

node_modules\_webpack@1.15.0@webpack\lib\TemplatedPathPlugin.js:50

                        if(!allowEmpty) throw new Error("Path variable " + match

 + " not implemented in this context: " + input);

                                        ^


Error: Path variable [chunkhash:8] not implemented in this context: fonts/icomoo

n.[chunkhash:8].svg

    at D:\BaiduNetdiskDownload\MY\React\Imooc\react-dianping\node_modules\_webpa

ck@1.15.0@webpack\lib\TemplatedPathPlugin.js:50:26

    at D:\BaiduNetdiskDownload\MY\React\Imooc\react-dianping\node_modules\_webpa

ck@1.15.0@webpack\lib\TemplatedPathPlugin.js:40:23

    at RegExp.[Symbol.replace] (native)

    at RegExp.[Symbol.replace] (native)

    at String.replace (native)

    at Template.replacePathVariables (D:\BaiduNetdiskDownload\MY\React\Imooc\rea

ct-dianping\node_modules\_webpack@1.15.0@webpack\lib\TemplatedPathPlugin.js:71:4

)

    at Template.applyPlugins [as applyPluginsWaterfall] (D:\BaiduNetdiskDownload

\MY\React\Imooc\react-dianping\node_modules\_tapable@0.1.10@tapable\lib\Tapable.

js:37:47)

    at Compilation.getPath (D:\BaiduNetdiskDownload\MY\React\Imooc\react-dianpin

g\node_modules\_webpack@1.15.0@webpack\lib\Compilation.js:882:27)

    at Compilation.<anonymous> (D:\BaiduNetdiskDownload\MY\React\Imooc\react-dia

nping\node_modules\_webpack@1.15.0@webpack\lib\Compilation.js:821:21)

    at Array.forEach (native)

    at Compilation.createChunkAssets (D:\BaiduNetdiskDownload\MY\React\Imooc\rea

ct-dianping\node_modules\_webpack@1.15.0@webpack\lib\Compilation.js:820:31)

    at Compilation.<anonymous> (D:\BaiduNetdiskDownload\MY\React\Imooc\react-dia

nping\node_modules\_webpack@1.15.0@webpack\lib\Compilation.js:557:8)

    at Compilation.applyPluginsAsync (D:\BaiduNetdiskDownload\MY\React\Imooc\rea

ct-dianping\node_modules\_tapable@0.1.10@tapable\lib\Tapable.js:60:69)

    at Compilation.seal (D:\BaiduNetdiskDownload\MY\React\Imooc\react-dianping\n

ode_modules\_webpack@1.15.0@webpack\lib\Compilation.js:525:7)

    at Compiler.<anonymous> (D:\BaiduNetdiskDownload\MY\React\Imooc\react-dianpi

ng\node_modules\_webpack@1.15.0@webpack\lib\Compiler.js:397:15)

    at D:\BaiduNetdiskDownload\MY\React\Imooc\react-dianping\node_modules\_tapab

le@0.1.10@tapable\lib\Tapable.js:103:11

    at Compilation.<anonymous> (D:\BaiduNetdiskDownload\MY\React\Imooc\react-dia

nping\node_modules\_webpack@1.15.0@webpack\lib\Compilation.js:445:10)

    at D:\BaiduNetdiskDownload\MY\React\Imooc\react-dianping\node_modules\_webpa

ck@1.15.0@webpack\lib\Compilation.js:417:12

    at D:\BaiduNetdiskDownload\MY\React\Imooc\react-dianping\node_modules\_webpa

ck@1.15.0@webpack\lib\Compilation.js:332:10

    at D:\BaiduNetdiskDownload\MY\React\Imooc\react-dianping\node_modules\_async

@1.5.2@async\lib\async.js:52:16

    at done (D:\BaiduNetdiskDownload\MY\React\Imooc\react-dianping\node_modules\

_async@1.5.2@async\lib\async.js:246:17)

    at D:\BaiduNetdiskDownload\MY\React\Imooc\react-dianping\node_modules\_async

@1.5.2@async\lib\async.js:44:16

    at _combinedTickCallback (internal/process/next_tick.js:73:7)

    at process._tickCallback (internal/process/next_tick.js:104:9)


npm ERR! Windows_NT 6.1.7601

npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\

node_modules\\npm\\bin\\npm-cli.js" "run" "build"

npm ERR! node v6.10.3

npm ERR! npm  v3.10.10

npm ERR! code ELIFECYCLE

npm ERR! react-dianping-webpack@1.0.0 build: ` set NODE_ENV=production && webpac

k --config ./webpack.production.config.js --progress --colors`

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the react-dianping-webpack@1.0.0 build script ' set NODE_ENV=

production && webpack --config ./webpack.production.config.js --progress --color

s'.

npm ERR! Make sure you have the latest version of node.js and npm installed.

npm ERR! If you do, this is most likely a problem with the react-dianping-webpac

k package,

npm ERR! not with npm itself.

npm ERR! Tell the author that this fails on your system:

npm ERR!      set NODE_ENV=production && webpack --config ./webpack.production.c

onfig.js --progress --colors

npm ERR! You can get information on how to open an issue for this project with:

npm ERR!     npm bugs react-dianping-webpack

npm ERR! Or if that isn't available, you can get their info via:

npm ERR!     npm owner ls react-dianping-webpack

npm ERR! There is likely additional logging output above.


npm ERR! Please include the following file with any support request:

npm ERR!     D:\BaiduNetdiskDownload\MY\React\Imooc\react-dianping\npm-debug.log


0
0

双越

2017-07-17

把前面的 rd/s/q build && 删掉再试试,看行吗?

0
17
双越
回复
低级前端开花工程师
不要重复提交问题,统一去 http://coding.imooc.com/learn/questiondetail/19480.html 回复吧
2017-08-03
共17条回复

React高级实战 打造大众点评Web App

已经对React Router4与Webpack2进行了项目升级

1711 学习 · 707 问题

查看课程