question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'args.push is not a function' when trying to deploy

See original GitHub issue

Hello,

Apologies if this is not new but I have has look through the issues and can’t see anything related.

I’ve been trying to use the CLI this morning but am getting the following error:

/Users/james/.nvm/versions/node/v6.2.0/lib/node_modules/netlify-cli/node_modules/commander/index.js:298
      args.push(self);
           ^

TypeError: args.push is not a function
    at Command.listener (/Users/james/.nvm/versions/node/v6.2.0/lib/node_modules/netlify-cli/node_modules/commander/index.js:298:12)
    at emitOne (events.js:101:20)
    at Command.emit (events.js:188:7)
    at Command.parseOptions (/Users/james/.nvm/versions/node/v6.2.0/lib/node_modules/netlify-cli/node_modules/commander/index.js:690:14)
    at Command.parse (/Users/james/.nvm/versions/node/v6.2.0/lib/node_modules/netlify-cli/node_modules/commander/index.js:455:21)
    at Object.<anonymous> (/Users/james/.nvm/versions/node/v6.2.0/lib/node_modules/netlify-cli/bin/cli.js:96:9)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)

As you can see I’m using node 6.2.0, I’ve also tried using node 0.12 just to see if it was something to do with node versions.

The command that I ran was netlify deploy dist -e testing which is what I have always run. Also worth noting that I installed netlify-cli today on my machine (just as it does on the CI I use where I saw the error originally)

I did suspect it might have been a package update - I’ve taken a look at commander but it doesn’t seem to have changed that recently.

Any help on this would be greatly appreciated!

All the best,

James

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
maxdanilovcommented, Mar 14, 2017

Workaround is to use the previous version instead: npm install netlify-cli@1.1.0

2reactions
darkcloud1801commented, Mar 14, 2017

They just pushed out version 1.2.2 that fixes the issue. for me at least. I was using the -e attribute to target a specific environment

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught TypeError: data.push is not a function - Stack Overflow
I am trying to push data.
Read more >
TypeError: push is not a function in JavaScript | bobbyhadz
The "push is not a function" error occurs when the push() method is called on a value that is not an array. To...
Read more >
Function.prototype.apply() - JavaScript - MDN Web Docs
The apply() method calls the specified function with a given this value, and arguments provided as an array (or an array-like object).
Read more >
How to Handle JavaScript Uncaught TypeError: “x” is Not a ...
The Javascript TypeError: "x" is not a function occurs when calling a function on a value or object, which is not actually a...
Read more >
How To Get Around .Push Is Not A Function In JavaScript
It means that the expression did not return a function object This is a common JavaScript error that happens when you try to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found