Zsh: command not found: webpack

后端 未结 6 969
借酒劲吻你
借酒劲吻你 2021-02-04 01:54

I\'m learning React and installed webpack through npm to my project directory but zsh is not finding the command even though I can see webpack installed in my project. I used

6条回答
  •  闹比i
    闹比i (楼主)
    2021-02-04 02:39

    Installing node modules globally is a quick solution, but i recommend to add ./node_modules/.bin to the path variable and try to understand, what's the problem.

    Execute

    ~ export PATH="./node_modules/.bin:$PATH"
    

    Afterwards you can simply use all packages installed locally in your project. Also commands like mocha or eslint can be executed without installing these packages globally. There are several good explanations out there maybe also read this answer.

提交回复
热议问题