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

Windows: Module build failed: Error: Couldn't find preset "es2015" relative to directory "." #45

Closed
netsi1964 opened this issue Sep 16, 2016 · 9 comments

Comments

@netsi1964
Copy link

I get this build error when I try to npm start

Module build failed: Error: Couldn't find preset "es2015" relative to directory "."
@stylesuxx
Copy link
Owner

Which node version are you using?

node -v

If you can, please use 6.x.x

@netsi1964
Copy link
Author

I use: v4.2.4
On the Node website they state this:

Current version: v4.5.0 (includes npm 2.15.9)

So @stylesuxx you want me to get version 6 and also run on a beta version of npm? (version 3) ?

@stylesuxx
Copy link
Owner

4.5.0 is LTS
6.x.x is Current

And the generator should work with node >= 4.5.0. Also since node 5.0.0 npm 3.x.x is used. It is not beta, it is the version node is "bundled" with. You can check the node release history here => https://nodejs.org/en/download/releases/ it also lists the npm version it came bundled with.

@netsi1964
Copy link
Author

@stylesuxx Now I have this setup:

node: 3.10.8
npm: 3.10.8

still I get this error when running npm start

ERROR in ./src/index.js
Module build failed: Error: Couldn't find preset "es2015" relative to directory "."

I have done npm install before doing this...
I am running windows 7.

@stylesuxx
Copy link
Owner

stylesuxx commented Sep 16, 2016

Node 3.10.8? I guess that is a typo. Point why I am asking for your versions is, so that I can play it through with the exact versions. Last weekend I tried with node v.4.5.0 all the way up to v6.5.0, with 3.x npm without a problem.

The following might help (I'd still rather debug the current problem):

npm install babel-preset-es2015

Also did you clear your projects node_modules directory after switching versions, before running npm install the second time?

@netsi1964
Copy link
Author

Thank you. It solved the problem!
I want to share this info however. I got this note as I did the npm start:

This preset is no longer necessary and can be replaced by the following:
        presets: [
                ["es2015", { "modules": false }]
        ]

So perhaps something should be changed in the generator. Have a great day! :-) You may mark this issue as solved.

@sthzg
Copy link

sthzg commented Sep 16, 2016

hi, just stumbled over this. @netsi1964 the deprecation warning can be solved by updating your .babelrc to read like this. This is already fixed in the base template repo, but afaik not yet published.

Concerning the npm install babel-preset-es2015: I've also started hitting that lately (on two build servers, not locally). We might have to check whether something changed in the type of dependencies, that lets babel-preset-es2015 miss all the sudden. Would definitely be an issue on the template repo (I'll file and check it there).

@netsi1964
Copy link
Author

I tried to uninstall the babel-preset-es2015 and updated the .babelrc and then ran the npm start.
I then got an error again.
I then reinstalled the babel-preset-es2015 and did a npm start again which lead to the app working and without getting any messages related to the .babelrc settings.

@stylesuxx stylesuxx reopened this Sep 16, 2016
@sthzg
Copy link

sthzg commented Sep 16, 2016

@netsi1964 that is expected. The deprecation warning and the error are two separate issues. The npm install gets the error out of the way, the updated .babelrc the deprecation warning.

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

3 participants