chenliang2016/CLReactAntDesign

npm run pub报错: 'export' 不是内部或外部命令

hexian opened this issue · 1 comments

H:\nodejs\CLReactAntDesign-master\backend>npm run pub

CLAntDFrame@1.0.0 pub H:\nodejs\CLReactAntDesign-master\backend
node ./tools/gulpfile.js&&export NODE_ENV=PROD&&node ./tools/webpack.config.js

'export' 不是内部或外部命令,也不是可运行的程序或批处理文件。
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! CLAntDFrame@1.0.0 pub: node ./tools/gulpfile.js&&export NODE_ENV=__PROD__&&node ./tools/webpack.config.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the CLAntDFrame@1.0.0 pub script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\hexian\AppData\Roaming\npm-cache_logs\2018-04-12T08_20_15_348Z-debug.log

将package.json里面
"scripts": {
"dev": "node ./tools/gulpfile.js&&node ./tools/webpack.config.js",
"pub": "node ./tools/gulpfile.js&&export NODE_ENV=PROD&&node ./tools/webpack.config.js"
}

改为:

"scripts": {
"dev": "node ./tools/gulpfile.js&&node ./tools/webpack.config.js",
"pub": "node ./tools/gulpfile.js&&set NODE_ENV=PROD&&node ./tools/webpack.config.js"
}

打包成功了