node.js - Webpack React Error -
i restarted mac, after got errors...
babel has switched babel-core, uninstalled , changed loader in webpack babel-core.
now when run npm run bundle
these errors:
/usr/local/lib/node_modules/webpack/node_modules/loader-runner/lib/loadloader.js:35 throw new error("module '" + loader.path + "' not loader (must have normal or pitch function)"); ^ error: module '/users/imac/desktop/fakeeh/node_modules/babel-core/index.js' not loader (must have normal or pitch function) @ loadloader (/usr/local/lib/node_modules/webpack/node_modules/loader-runner/lib/loadloader.js:35:10) @ iteratepitchingloaders (/usr/local/lib/node_modules/webpack/node_modules/loader-runner/lib/loaderrunner.js:169:2) @ runloaders (/usr/local/lib/node_modules/webpack/node_modules/loader-runner/lib/loaderrunner.js:362:2) @ normalmodule.dobuild (/usr/local/lib/node_modules/webpack/lib/normalmodule.js:181:3) @ normalmodule.build (/usr/local/lib/node_modules/webpack/lib/normalmodule.js:274:15) @ compilation.buildmodule (/usr/local/lib/node_modules/webpack/lib/compilation.js:149:10) @ modulefactory.create (/usr/local/lib/node_modules/webpack/lib/compilation.js:447:10) @ factory (/usr/local/lib/node_modules/webpack/lib/normalmodulefactory.js:241:5) @ applypluginsasyncwaterfall (/usr/local/lib/node_modules/webpack/lib/normalmodulefactory.js:94:13) @ /usr/local/lib/node_modules/webpack/node_modules/tapable/lib/tapable.js:268:11 @ normalmodulefactory.params.normalmodulefactory.plugin (/usr/local/lib/node_modules/webpack/lib/compatibilityplugin.js:52:5) @ normalmodulefactory.applypluginsasyncwaterfall (/usr/local/lib/node_modules/webpack/node_modules/tapable/lib/tapable.js:272:13) @ resolver (/usr/local/lib/node_modules/webpack/lib/normalmodulefactory.js:69:10) @ process.nexttick (/usr/local/lib/node_modules/webpack/lib/normalmodulefactory.js:194:7) @ _combinedtickcallback (internal/process/next_tick.js:73:7) @ process._tickcallback (internal/process/next_tick.js:104:9) npm err! darwin 16.6.0 npm err! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "bundle" npm err! node v6.11.2 npm err! npm v3.10.10 npm err! code elifecycle npm err! fakeeh@0.1.0 bundle: `webpack` npm err! exit status 1 npm err! npm err! failed @ fakeeh@0.1.0 bundle script 'webpack'. npm err! make sure have latest version of node.js , npm installed. npm err! if do, problem fakeeh package, npm err! not npm itself. npm err! tell author fails on system: npm err! webpack npm err! can information on how open issue project with: npm err! npm bugs fakeeh npm err! or if isn't available, can info via: npm err! npm owner ls fakeeh npm err! there additional logging output above. npm err! please include following file support request: npm err! /users/imac/desktop/fakeeh/npm-debug.log
here webpack config:
const path = require('path'); module.exports = { // entry file bundle entry: path.join(__dirname, '/client/src/app.jsx'), // bundle file in result output: { path: path.join(__dirname, '/client/dist/js'), filename: 'app.js', }, module: { // apply loaders files meet given conditions loaders: [{ test: /\.jsx?$/, include: path.join(__dirname, '/client/src'), loader: 'babel-core', }], }, // start webpack in watch mode, webpack rebuild bundle on changes watch: true };
after these, in chrome console, same error...module build failed: error: node api babel has been moved babel-core.
what think problem is?
note: npm , node in latest versions!!!
use babel-loader
instead of babel-core
Comments
Post a Comment