読者です 読者をやめる 読者になる 読者になる

へっぽこびんぼう野郎のnewbie日記

けろけーろ(´・ω・`)!

Big "Babel" Is Watching Another ".babelrc" in Your Home Directory, Root Directory, And So On :)

f:id:haruharu1:20160704091104p:plain

ERROR in ./foo.js
Module build failed: Error: Couldn't find preset "react" relative to directory "/Users"
    at /Users/usrNeko/es6teset/node_modules/babel-core/lib/transformation/file/options/option-manager.js:395:17
    at Array.map (native)
    at OptionManager.resolvePresets (/Users/usrNeko/es6teset/node_modules/babel-core/lib/transformation/file/options/option-manager.js:387:20)
    at OptionManager.mergePresets (/Users/usrNeko/es6teset/node_modules/babel-core/lib/transformation/file/options/option-manager.js:370:10)
    at OptionManager.mergeOptions (/Users/usrNeko/es6teset/node_modules/babel-core/lib/transformation/file/options/option-manager.js:330:14)
    at OptionManager.addConfig (/Users/usrNeko/es6teset/node_modules/babel-core/lib/transformation/file/options/o

preset "react"?
I never wrote this!!
I don't want to use preset react. just only preset "es2015"!!
Here is the evidence.
f:id:haruharu1:20160704092738p:plain

I don't want you to use preset 'react'. Thank you :)

However babel still cause an error.

ERROR in ./foo.js
Module build failed: Error: Couldn't find preset "react" relative to directory "/Users"
    at /Users/usrNeko/es6teset/node_modules/babel-core/lib/transformation/file/options/option-manager.js:395:17
    at Array.map (native)
    at OptionManager.resolvePresets (/Users/usrNeko/es6teset/node_modules/babel-core/lib/transformation/file/options/option-manager.js:387:20)
    at OptionManager.mergePresets (/Users/usrNeko/es6teset/node_modules/babel-core/lib/transformation/file/options/option-manager.js:370:10)
    at OptionManager.mergeOptions (/Users/usrNeko/es6teset/node_modules/babel-core/lib/transformation/file/options/option-manager.js:330:14)
    at OptionManager.addConfig (/Users/usrNeko/es6teset/node_modules/babel-core/lib/transformation/file/options/o

Because Google does not teach me how to fix this, I read sources.

./node_modules/babel-core/lib/transformation/file/options/option-manager.js
f:id:haruharu1:20160704091543p:plain

Babel is going to find .babelrc my home directory :)
f:id:haruharu1:20160704091753p:plain

Oh, some time ago, certainly I wrote this here. fuck me.
f:id:haruharu1:20160704091957p:plain
then remove this.
f:id:haruharu1:20160704092112p:plain

Gotcha.
f:id:haruharu1:20160704092150p:plain

追記:
キャッシュせんのかーい