Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR in Entry module not found: Error: Can't resolve 'babel' #234

Closed
ciqulover opened this issue Nov 14, 2016 · 10 comments
Closed

ERROR in Entry module not found: Error: Can't resolve 'babel' #234

ciqulover opened this issue Nov 14, 2016 · 10 comments

Comments

@ciqulover
Copy link

ciqulover commented Nov 14, 2016

I got this error when i type the following, and before that I have installed the dependencies without error:
npm run build
Two days ago, I typed this command and build, it works well.
'webpack-simple' is the template in this project.
I know this may result from the npm package.
Maybe some packages owner delete their dependency, or just the template should be updated?

The detail shows here:

E:\webstorm\vue-project>npm run build

> vue-project@ build E:\webstorm\vue-project
> cross-env NODE_ENV=production webpack --progress --hide-modules

Hash: c09da3a503626da73c26
Version: webpack 2.1.0-beta.26
Time: 54ms

ERROR in Entry module not found: Error: Can't resolve 'babel' in 'E:\webstorm\vue-project'

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users\\ycwalker\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
npm ERR! node v6.8.1
npm ERR! npm  v3.10.6
npm ERR! code ELIFECYCLE
npm ERR! vue-project@ build: `cross-env NODE_ENV=production webpack --progress --hide-modules`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the vue-project@ build script 'cross-env NODE_ENV=production webpack --progress --hide-modules'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the vue-project package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     cross-env NODE_ENV=production webpack --progress --hide-modules
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs vue-project
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls vue-project
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     E:\webstorm\vue-project\npm-debug.log

Thanks.

@zacard-orc
Copy link

+1

@donPuerto
Copy link

I got the same too.. Any problem?

@akifo
Copy link

akifo commented Nov 14, 2016

+1

@cnahliu
Copy link

cnahliu commented Nov 14, 2016

是webpack版本太高了,我暂时的解决办法是指定webpack的版本。

--- a/package.json
+++ b/package.json
@@ -18,7 +18,7 @@
     "css-loader": "^0.25.0",
     "file-loader": "^0.9.0",
     "vue-loader": "^9.7.0",
-    "webpack": "^2.1.0-beta.25",
+    "webpack": "2.1.0-beta.25",
     "webpack-dev-server": "^2.1.0-beta.0"
   }
 }

cnahliu added a commit to cnahliu/webpack-simple that referenced this issue Nov 14, 2016
@ozeebee
Copy link

ozeebee commented Nov 14, 2016

if you want to work with latest versions of webpack@2.1.0-beta.26 and webpack-dev-server@2.1.0-beta.11, you can simply add this to your webpack configuration:

  resolveLoader: {
    moduleExtensions: ['-loader']
  },

This is because webpack@2.1.0-beta.26 introduced a breaking change: they no longer add the -loader suffix when resolving loaders.

Source: vuejs-templates/webpack-simple#39 (comment)

@MincePie
Copy link

Ozeebee, I tried adding this to my web pack config.js, but still get this error:

ERROR in Entry module not found: Error: Can't resolve 'babel-loader' in

@ozeebee
Copy link

ozeebee commented Jun 12, 2017

@MincePie This might be due to missing dependencies.
You can try to remove your node_modules/ directory (and yarn.lock file if you're using yarn) and re-install everything with npm install or yarn install.

Source: https://stackoverflow.com/questions/42781250/error-webpack-2-cant-resolve-babel-loader

@MincePie
Copy link

Thanks @ozeebee - i deleted and reinstalled. That worked.

@maksim-bodak
Copy link

I had this problem in atom's terminal.
I have run npm install in another terminal and after that everything worked great!
https://stackoverflow.com/questions/42781250/error-webpack-2-cant-resolve-babel-loader/42783126#42783126?newreg=eacdd98460cc400b845be815f1e652cb

@bit-wizzard
Copy link

Greetings! Just solved this problem for me.

In my case, it was caused by 2 npm modules I decided to use on my React Application for validating
the Register Form Inputs, they were "validator" and "is-empty".

I thought it was OK since I have already used it succesfully for server side validation, but I was wrong. I am not completely sure, but I think these modules are only available to be used on React apps runned below Babel.

After i removed them using "yarn remove "(or "npm remove", whatever you prefer), and restarted the react server, the problem has been solved for me.

Hope this works 4 you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants