Webpack:这是预期的行为吗?

时间:2016-11-30 16:11:09

标签: webpack vuejs2

我正在使用带有VueJS v2.x的webpack-simple模板。首先,运行“npm run build”失败。运行“npm run dev”有效。如果在运行“npm run dev”之前我的源代码中有错误,则命令失败。 我为没有显示任何代码而道歉,但我不需要帮助修复我的代码。我想知道这是不是webpack如何工作。如果出现错误,则会发出无用的错误消息。这是错误:

npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "dev"
npm ERR! node v7.1.0
npm ERR! npm  v3.10.9
npm ERR! code ELIFECYCLE
npm ERR! gg@ dev: `cross-env NODE_ENV=development webpack-dev-server --open --inline --hot`
npm ERR! Exit status 3221226505
npm ERR!
npm ERR! Failed at the gg@ dev script 'cross-env NODE_ENV=development webpack-dev-server --open --inline --hot'.
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 gg package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     cross-env NODE_ENV=development webpack-dev-server --open --inline --hot
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs gg
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls gg
npm ERR! There is likely additional logging output above.

1 个答案:

答案 0 :(得分:0)

问题来自node和npm。我在win10上运行并使用节点v7.10。降级到6.9后,一切都开始正常工作