webpack 执行error:zsh: command not found: webpack
npm install webpack -D
npm install webpack-cli -D
配置好webpack.config.js文件
但执行webpack报错
zsh: command not found: webpack
因为当前环境变量中,没有找到对应的命令,解决方法如下:
➜ echo 'export PATH="./node_modules/.bin:$PATH"' >> ~/.zshrc ➜ source ~/.zshrc
转载自:https://segmentfault.com/a/1190000023412433