Zsh: command not found: webpack

后端 未结 6 984
借酒劲吻你
借酒劲吻你 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条回答
  •  孤街浪徒
    2021-02-04 02:52

    There is no need to install webpack globally.

    Try my way:

    First, in your package.json file, add this:

    "scripts": {
       "start": "webpack"
    },
    

    Then, in your terminal, run

    $npm start
    

    Another quick way: Just run (Yes, it is 'npx')

    $npx webpack
    

    That's all.

提交回复
热议问题