Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools Why Use Babel?

npm install error

I have node and npm installed on my computer. I am using my own resources, and not the launch workspace that treehouse provides. I keep getting the following error message. Can anyone offer a solution? Thanks in advance!

$ npm install --save-dev babel-cli
npm WARN saveError ENOENT: no such file or directory, open 'C:\xampp\htdocs\babel\babel-workshop\package.json'
C:\xampp\htdocs\babel\babel-workshop
`-- babel-cli@6.26.0

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN enoent ENOENT: no such file or directory, open 'C:\xampp\htdocs\babel\babel-workshop\package.json'
npm WARN babel-workshop No description
npm WARN babel-workshop No repository field.
npm WARN babel-workshop No README data
npm WARN babel-workshop No license field.

3 Answers

Ari Misha
Ari Misha
19,323 Points

Hiya there! Did you cd into the project root file which is as same level as your package.json? Looks like you're in the ~ (tilda) directory and tryna save babel-cli as your devDependency.

~ Ari

Thanks Ari, i found out the problem. I missed the step where I needed to clone the cli-lesson branch and switch to that branch. I'm assuming this is an older tutorial because on the next step I got a warning saying they recommend babel-preset-env because babel-preset-es2015 is deprecated. Not sure exactly what it means but thats the message it gave me.

Kiril Christov
Kiril Christov
9,208 Points

Hi, everything works perfectly for me until the npm command.

mac2:babel-workshop kiksy$ npm install --save-dev babel-cli -bash: npm: command not found