Marak / colors.js

get colors in your node.js console
https://github.com/Marak/colors.js
Other
5.17k stars 446 forks source link

Builder is not defined #144

Closed uuperi closed 6 years ago

uuperi commented 8 years ago

Hi. This is my first time reporting any issues and I'm also kind of new to programming with node.js so pardon me if I'm forgetting to include something relevant as context but yeah. So my problem is that when I am trying to use nexe-named package to distribute my .js file to an exe file it's telling me that 'colours' -script's builder is not defined and I have no idea how to fix this and not even sure if this is the right place to report about this. I did not found anyone else with this problem by googling so i decided to issue this. I am using node 5.0

Here is my code that causes the error:

var nexe = require('nexe');

nexe.compile({
    input: './tradebottesti.js',
    output: './out.nex',
    nodeVersion: '5.0.0',
    nodeTempDir: './src',
    python: 'C:/Python27',
    resourceFiles: [ 'config.json' ],
    flags: false,
    framework: "nodejs"
}, function(err) {
    console.log(err);
});

And here is the error that console prints out:

C:\Users\tuomas\Tradebotti>node build.js
----> set python as C:\Python27
----> framework => nodejs
----> bundle ./tradebottesti.js
C:\Users\tuomas\node_modules\colors\lib\colors.js:69
    return applyStyle.apply(builder, arguments);
                            ^

ReferenceError: builder is not defined
    at Object.builder (C:\Users\tuomas\node_modules\colors\lib\colors.js:69:29)
    at _log (C:\Users\tuomas\node_modules\nexe\lib\log.js:49:33)
    at Deps.<anonymous> (C:\Users\tuomas\node_modules\nexe\lib\bundle.js:101:9)
    at emitTwo (events.js:87:13)
    at Deps.emit (events.js:172:7)
    at C:\Users\tuomas\node_modules\module-deps\index.js:342:18
    at onresolve (C:\Users\tuomas\node_modules\module-deps\index.js:161:25)
    at C:\Users\tuomas\node_modules\browser-resolve\index.js:252:24
    at C:\Users\tuomas\node_modules\resolve\lib\async.js:46:14
    at process (C:\Users\tuomas\node_modules\resolve\lib\async.js:173:43)
andrewc89 commented 7 years ago

I am having a similar issue. I am using webpack and after adding the resolve-url-loader I started having issues when building.

Here are my relevant loaders:

    {
        test: /\.css$/,
        exclude: /node_modules/,
        loader: 'style!css!resolve-url'
    },
    {
        test: /\.scss$/,
        exclude: /node_modules/,
        loader: 'style!css!resolve-url!sass?sourceMap'
    },

I receive the following error:

WARNING in ./~/css-loader!./~/resolve-url-loader!./~/sass-loader?sourceMap!./src/styles/styles.scss
  resolve-url-loader cannot operate: CSS error
  builder is not defined
  at Object.builder (*** a directory I've removed ***\www\node_modules\colors\lib\colors.js:68:29)

I found this issue on another project. The author has a similar issue and his fix, outlined in his initial comment, works for me as well.

Any ideas?

DABH commented 6 years ago

Seems like this may have been resolved by newer versions of Node? If there are still issues with this and the latest version of Node, and using colors@next, feel free to re-open and we can investigate further.