Error: Cannot find module 'webpack'

后端 未结 17 1949
一整个雨季
一整个雨季 2020-12-22 16:49

I\'m just getting started with webpack and am having difficulty getting the multiple-entry-points sample to build. The webpack.config.js file in the example includes the li

相关标签:
17条回答
  • 2020-12-22 17:48

    npm link webpack worked for me.

    My webpack configuration: "webpack": "^4.41.2", "webpack-dev-server": "^3.9.0", "webpack-cli": "^3.3.10"

    0 讨论(0)
  • 2020-12-22 17:50

    Open npm command prompt and -- cd solution folder and then just run npm link webpack in NPM cmd prommt and re build..

    0 讨论(0)
  • 2020-12-22 17:52

    While working on windows, I've installed webpack locally and it fixed my problem

    So, on your command prompt, go to the directory of which you want to run webpack, install webpack locally (without the -g) and enjoy...

    0 讨论(0)
  • 2020-12-22 17:53

    You can try this.

    npm install --only=dev
    

    It works for me.

    0 讨论(0)
  • 2020-12-22 17:53

    Nothing suggested above worked for me (including the NODE_PATH variable). I created a sym link of "node_modules" from my local folder to the global AppData(eg below) and it worked like charm.

    C:\Users\mmoinuddin\AppData\Roaming\npm>mklink /D node_modules c:\essportreact\day1\node_modules
    symbolic link created for node_modules <<===>> c:\essportreact\day1\node_modules
    C:\essportreact\day1>webpack
    Hash: 2a82a67f90f9aa05ab4a
    Version: webpack 1.15.0
    
    0 讨论(0)
提交回复
热议问题