[webpack]zsh: command not found: webpack

yezitoo 2020-05-01

环境:mac 

工程已安装局部依赖包

npm install webpack webpack-cli -D

配置好webpack.config.js文件

但执行webpack报错

zsh: command not found: webpack

因为当前环境变量中,没有找到对应的命令,解决方法如下:

? echo ‘export PATH="./node_modules/.bin:$PATH"‘ >> ~/.zshrc
? source ~/.zshrc

相关推荐