Skip to content
This repository has been archived by the owner on Feb 19, 2019. It is now read-only.

Babel won't compile #24

Open
naclcaleb opened this issue Oct 20, 2018 · 3 comments
Open

Babel won't compile #24

naclcaleb opened this issue Oct 20, 2018 · 3 comments
Labels
compiler-issue There is an issue with the compiler

Comments

@naclcaleb
Copy link
Contributor

naclcaleb commented Oct 20, 2018

Describe the bug
When trying npm run app, I got an error about the webpack config file. I fixed those errors by editing the file; this is what it is now:

import path from 'path';
import HtmlWebpackPlugin from 'html-webpack-plugin';

export default {
    devtool: 'inline-source-map',
    mode:"development",
    entry: [
        path.resolve(__dirname, 'src/index')
    ],
    target: 'web',
    output: {
        path: path.resolve(__dirname, 'src'),
        publicPath: '/',
        filename: 'bundle.js'
    },
    plugins: [
        // Create HTML file that includes reference to bundled JS.
        new HtmlWebpackPlugin({
            template: 'src/index.html',
            minify: {
                removeComments: true,
                collapseWhitespace: true,
                removeRedundantAttributes: true,
                useShortDoctype: true,
                removeEmptyAttributes: true,
                removeStyleLinkTypeAttributes: true,
                keepClosingSlash: true,
                minifyJS: true,
                minifyCSS: true,
                minifyURLs: true
            },
            inject: true
        })
    ],
    module: {
        rules: [{
                test: /\.js$/,
                exclude: /node_modules/,
                loaders: ['babel-loader']
            },
            {
                test: /\.css$/,
                loaders: ['style', 'css']
            }
        ]
    }
}

Now all the webpack errors have stopped, but I am getting an error about babel:

ERROR in ./src/index.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: Cannot find module '@babel/core'
 babel-loader@8 requires Babel 7.x (the package '@babel/core'). If you'd like to use Babel 6.x ('babel-core'), you should install 'babel-loader@7'.
    at Function.Module._resolveFilename (module.js:542:15)
    at Function.Module._load (module.js:472:25)
    at Module.require (module.js:585:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/caleb/Downloads/octo-turbo-master/node_modules/babel-loader/lib/index.js:10:11)
    at Module._compile (module.js:641:30)
    at Module._extensions..js (module.js:652:10)
    at Object.require.extensions.(anonymous function) [as .js] (/home/caleb/Downloads/octo-turbo-master/node_modules/babel-register/lib/node.js:152:7)
    at Module.load (module.js:560:32)
    at tryModuleLoad (module.js:503:12)
 @ multi ./src/index main[0]

It seems that the package @babel/core needs to be installed...

npm install @babel/core

However, this gives an error about not finding property 'bindings'.

To Reproduce
Steps to reproduce the behavior:

  1. Download and extract the zip file, and follow the instructions on the docs page.
  2. I am using npm version 5.5.1, node version 9.0.0, and nodejs version 4.2.6

Expected behavior
I would expect to see the index.js file compile and print to the terminal.

Desktop (please complete the following information):

  • OS: GalliumOS Braswell
@rocketbear27 rocketbear27 added the compiler-issue There is an issue with the compiler label Nov 8, 2018
@naclcaleb
Copy link
Contributor Author

I see you assigned me to this, but I don't know how to fix it. I don't often work with npm, nodejs, or babel, so I can't help much with that.

@rocketbear27
Copy link
Owner

This repo will be marked as archived soon

@naclcaleb
Copy link
Contributor Author

👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
compiler-issue There is an issue with the compiler
Projects
None yet
Development

No branches or pull requests

2 participants