1

trying to set up a Filewatcher with Intellij in order to use ES6 with Babel transpiler. I have followed their guide here, which seemed to install fine except for when I try to write javascript code and it executes the transpiler code, I get this error:

Error: Couldn't find preset "es2015" relative to directory "/Volumes/ShanStore/Main/Projects/NewWebsite"
at /Users/Shan/node_modules/babel-core/lib/transformation/file/options/option-manager.js:281:17
at Array.map (native)
at OptionManager.resolvePresets (/Users/Shan/node_modules/babel-core/lib/transformation/file/options/option-manager.js:265:20)
at OptionManager.mergePresets (/Users/Shan/node_modules/babel-core/lib/transformation/file/options/option-manager.js:254:10)
at OptionManager.mergeOptions (/Users/Shan/node_modules/babel-core/lib/transformation/file/options/option-manager.js:239:14)
at OptionManager.init (/Users/Shan/node_modules/babel-core/lib/transformation/file/options/option-manager.js:338:12)
at File.initOptions (/Users/Shan/node_modules/babel-core/lib/transformation/file/index.js:216:65)
at new File (/Users/Shan/node_modules/babel-core/lib/transformation/file/index.js:137:24)
at Pipeline.transform (/Users/Shan/node_modules/babel-core/lib/transformation/pipeline.js:46:16)
at transform (/Users/Shan/node_modules/babel-cli/lib/babel/util.js:50:22)

I have Node v6.4.0 and npm 3.10.3 installed. I have a file named .babelrc in my root directory like so—

NewWebsite
  |_ .babelrc
  |_ index.html
  |_ script.js

and I ran these commands to install babel related things:

sudo npm install --save-dev babel-cli
sudo npm install --save-dev babel-preset-es2015

My .babelrc file looks like this:

{
  "presets": ["es2015"]
}

I've searched through the various solutions on here and none of them have worked. I have no idea what's wrong here! Any help?

twernt
  • 20,271
  • 5
  • 32
  • 41
shan
  • 3,035
  • 5
  • 34
  • 50
  • Is there a particular reason you are using `sudo` when installing local npm packages? – BenM Aug 30 '16 at 16:25

0 Answers0