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

[BUG] Missing required argument #1 #681

Closed
HotGreenPeas opened this issue Jan 12, 2020 · 84 comments
Closed

[BUG] Missing required argument #1 #681

HotGreenPeas opened this issue Jan 12, 2020 · 84 comments
Labels
Awaiting Information further information is requested Bug thing that needs fixing Needs Discussion is pending a discussion Registry specific to registry implementation

Comments

@HotGreenPeas
Copy link

npm ERR! typeerror Error: Missing required argument #1
npm ERR! typeerror at andLogAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:31:3)
npm ERR! typeerror at fetchPackageMetadata (/usr/share/npm/lib/fetch-package-metadata.js:51:22)
npm ERR! typeerror at resolveWithNewModule (/usr/share/npm/lib/install/deps.js:456:12)
npm ERR! typeerror at /usr/share/npm/lib/install/deps.js:457:7
npm ERR! typeerror at /usr/share/npm/node_modules/iferr/index.js:13:50
npm ERR! typeerror at /usr/share/npm/lib/fetch-package-metadata.js:37:12
npm ERR! typeerror at addRequestedAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:82:5)
npm ERR! typeerror at returnAndAddMetadata (/usr/share/npm/lib/fetch-package-metadata.js:117:7)
npm ERR! typeerror at pickVersionFromRegistryDocument (/usr/share/npm/lib/fetch-package-metadata.js:134:20)
npm ERR! typeerror at /usr/share/npm/node_modules/iferr/index.js:13:50
npm ERR! typeerror This is an error with npm itself. Please report this error at:
npm ERR! typeerror http://github.com/npm/npm/issues

npm-debug.log

@HotGreenPeas HotGreenPeas changed the title Missing required argument #1 [BUG] Missing required argument #1 Jan 12, 2020
@byv55f5f5
Copy link

Same here

@cerpusoddarne
Copy link

Same problem here.

@revoltek-daniel
Copy link

revoltek-daniel commented Jan 13, 2020

Same Problem here.
Deployment stops working today, on friday the build was completed without problems.

@Mico27
Copy link

Mico27 commented Jan 13, 2020

Same problem, Nothing changed since friday and it was working fine then.

@RyanMannix
Copy link

RyanMannix commented Jan 13, 2020

Same problem.

It appears something was released that breaks older versions of npm (we were using 3.5.2, the most current version using apt-get). We fixed this by updating to the latest version of npm as a RUN command in our Dockerfile

RUN npm install -g npm@latest

We were installing npm via apt-get in a list of apt installs, but the latest release of npm isn't available through the apt install option. So, after we install the old version of npm in the apt list we updated it on the next line of the Dockerfile with the command above. Hopefully updating it will not break anything you're doing, and hope this helps some of you.

@pettazz
Copy link

pettazz commented Jan 13, 2020

Ran into this as well, installing npm@latest seems to be a good enough workaround for now.

@mikemimik
Copy link
Contributor

@RyanMannix is there a chance you could provide some information about that Dockerfile?
Q: Which version of apt are you using?
Q: Does the Dockerfile run apt update before it installs packages?
Q: What repository/ies is/does apt point to?


The original issue has a npm-debug.log file that references [email protected] and [email protected]. As of January 1st, 2020 node@8 is no longer LTS maintenance is isn't supported by the OpenJS Foundation. If it's at all possible to update to node@10, it comes with [email protected] which is a much newer version than [email protected] (many changes and improvements).

If you're stuck at node@8, then I would recommend to anyone following that simply adding

RUN npm install -g npm@latest

to your Dockerfiles in order to get builds/deploys working again. I've created a TODO for myself to ask our engineering team if there were changes put forth on Friday.


Thanks for everyone speaking up about this and @pettazz for tweeting about it :D

@mikemimik mikemimik added Bug thing that needs fixing Community Needs Discussion is pending a discussion Awaiting Information further information is requested Registry specific to registry implementation labels Jan 14, 2020
@ljharb
Copy link
Contributor

ljharb commented Jan 14, 2020

@mikemimik its notable tho that this seems caused by a registry-side change, since it’s only started happening recently. I’ve seen it on node 5 on windows on npm versions that previously worked.

@clokep
Copy link

clokep commented Jan 14, 2020

I started hitting this as the other people. I believe that npm 3.5.2 (and node 8) is the latest version available from apt on Ubuntu 18.04 (which is the current LTS for Ubuntu). The command give above to update npm worked fine for me though. (Thanks!)

@RyanMannix
Copy link

RyanMannix commented Jan 16, 2020

@mikemimik
The Docker file based on Ubuntu 18.04
A: apt version 1.6.12
A: yes it does run apt update before it installs packages - you can upgrade and install packages in one "RUN" command, meaning fewer layers in your docker image.
A: Do you mean where it saves the packages locally or where it gets them from online? I believe the package curators need to submit them to apt for download, but you can search apt for available packages using apt search . (all packages, probably a really long list) or apt search <package-name> (for a specific package). See this link for more information about that

I unfortunately cannot share the docker file itself, but I can tell you we basically update apt, install apt packages listed in a requirements file, and then in this case apt update npm. Then pip install packages from a requirements list. I would expect something similar to this is available online if you search.

@isaacs
Copy link
Contributor

isaacs commented Jan 16, 2020

If someone is hitting this reliably, can you share your package.json file, or at least, the dependencies, devDependencies, and optionalDependencies sections?

I can't reproduce this with npm v3.5.2 just installing the packages shown in the debug log.

There was a registry-side change regarding urls in the /-/org/... path, but I don't see anywhere we're accessing that in the process of an install. I'd like to investigate just to ensure that there weren't any unforeseen side effects of that change, but at this time, I don't see how it could be related.

That being said, really, npm v3.5.2 is from 2015, and way out of any kind of LTS support by this team. Node 8 is end of life'd as of Jan 1 2020. So, the answer probably is to just upgrade your node and npm, and complain to your system package provider to upgrade off of those unsupported and insecure versions.

@ljharb
Copy link
Contributor

ljharb commented Jan 16, 2020

Since npm install -g npm is not safe on older nodes, and I’ve only added the appropriate logic to nvm, my appveyor setup is unable to test on node 5 on windows with this new breakage.

Prior to this commit: ljharb/json-file-plus@93c227c that package consistently failed in node 5 on appveyor.

@isaacs
Copy link
Contributor

isaacs commented Jan 16, 2020

my appveyor setup is unable to test on node 5 on windows with this new breakage.

Node 5 hit its end of life support date on 2016-06-30, 1295 days ago. It is not supported, and should not be expected to work with any recent or future version of npm.

@ljharb
Copy link
Contributor

ljharb commented Jan 16, 2020

That is certainly a stance you can take, but it remains the case that a registry change broke clients that previously worked just fine, and given that npm does not offer a simple way to upgrade to "the latest npm that works on an arbitrary node version", this is causing a lot of friction for use cases that worked fine for years until a week or two ago.

@isaacs
Copy link
Contributor

isaacs commented Jan 16, 2020

@ljharb Again, until I'm able to get evidence to the contrary (eg, with a reproducible case), I'm extremely dubious that this failure had anything to do with the registry changes that happened around the same time. It certainly wouldn't be the first time I was wrong about that, but it also wouldn't be the first time that something "worked" and then a bug lying in wait for years was found coincidentally around the same time as an unrelated change to the registry that was not the cause.

Without a reproduction case, it's all speculation. npm 3.5.2 is able to install all the packages referenced in the npm-debug.log file just fine, as far as I can tell.

@ljharb
Copy link
Contributor

ljharb commented Jan 17, 2020

You're unable to reproduce it with the json-file-plus repo, on Windows on x64 or on x86, on node 5 with stock npm?

@isaacs
Copy link
Contributor

isaacs commented Jan 17, 2020

@ljharb

You're unable to reproduce it with the json-file-plus repo, on Windows on x64 or on x86, on node 5 with stock npm?

I haven't tried in that configuration.

That's not how this error is happening, though:

1129 error Linux 5.0.0-32-generic
1130 error argv "/usr/bin/node" "/usr/bin/npm" "install"
1131 error node v8.10.0
1132 error npm  v3.5.2
1133 error code EMISSINGARG

So I'd be surprised if it's specific to Windows or node 5 in any way. It may well be that there is more than one way to get an EMISSINGARG, of course, but I'd strongly suspect that you are encountering a different error if it predominantly occurs on Windows using Node 5.

@quenbyako
Copy link

same shit too. @HotGreenPeas @byv55f5f5 @cerpusoddarne and all other guys who catch up this trouble, can you please write in this issue npm --version and node --version? thanks a lot!

my versions:

$ npm --version    
3.5.2
$ node --version                          
v8.10.0

@thoroc
Copy link

thoroc commented Mar 12, 2020

I am in the same boat with a Linux subsystem on Windows 10 with fresh install of node and npm:

npm ERR! Linux 4.4.0-18362-Microsoft
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "-g" "aws-cdk"
npm ERR! node v8.10.0
npm ERR! npm  v3.5.2
npm ERR! code EMISSINGARG

npm ERR! typeerror Error: Missing required argument #1
npm ERR! typeerror     at andLogAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:31:3)
npm ERR! typeerror     at fetchPackageMetadata (/usr/share/npm/lib/fetch-package-metadata.js:51:22)
npm ERR! typeerror     at resolveWithNewModule (/usr/share/npm/lib/install/deps.js:456:12)
npm ERR! typeerror     at /usr/share/npm/lib/install/deps.js:457:7
npm ERR! typeerror     at /usr/share/npm/node_modules/iferr/index.js:13:50
npm ERR! typeerror     at /usr/share/npm/lib/fetch-package-metadata.js:37:12
npm ERR! typeerror     at addRequestedAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:82:5)
npm ERR! typeerror     at returnAndAddMetadata (/usr/share/npm/lib/fetch-package-metadata.js:117:7)
npm ERR! typeerror     at pickVersionFromRegistryDocument (/usr/share/npm/lib/fetch-package-metadata.js:134:20)
npm ERR! typeerror     at /usr/share/npm/node_modules/iferr/index.js:13:50
npm ERR! typeerror This is an error with npm itself. Please report this error at:
npm ERR! typeerror     <http://github.com/npm/npm/issues>

@ironsoul0
Copy link

ironsoul0 commented Mar 13, 2020

Same here :(

Works fine on my machine but can not install dependencies on DigitalOcean Ubuntu machine.

@cmseal
Copy link

cmseal commented Mar 16, 2020

Same issue here since Friday using Ubuntu 18.04.4 LTS clean installs with the provider repo packages :( and just over a month until 20.04 LTS is released!

@shivapendem
Copy link

I got the same issue but i made if run perfectky by clearing the npm cauche, and then update and the npm to stable version and reinstall the values.

`
sudo npm cache clean -f
sudo npm install -g n
sudo n stable

`
then i installed using

pm2 install pm2-logrotate

@BraxtonLowers
Copy link

Updating and reinstalling the latest version of npm supported by the node version fixed this issue for me.

For anyone using nvm as their version manager on WSL 2, Ubuntu 18.04

sudo apt remove npm
nvm use <different node version>
nvm uninstall <your node version>
nvm install <your node version>
nvm install-latest-npm

I also likely had a conflicting installation of npm installed by the OS package manager instead of nvm, which may explain the benefit of running sudo apt remove npm in my case

@xjcl
Copy link

xjcl commented Apr 2, 2022

Just wanted to add that hash -d npm didn't work for me, maybe cos I use zsh. Try:

sudo npm install -g n
sudo n latest
sudo npm install -g npm
hash -r
npm i

@spenelladm
Copy link

I just ran into this, too.

nathanweeks added a commit to LegumeFederation/cmap-js that referenced this issue Jun 11, 2022
Add devcontainer upddate package.json to reflect the requirements:

* node 8 due to rollup-plugin-commonjs error with node >= 10:
  "The argument 'path' must be a string or Uint8Array without null bytes"
* npm >= 4 due to npm/cli#681
@rdeslonde
Copy link

For those who can't update their node and npm versions very easily, I was able to get my build working by updating npm to the latest version of 3, which ended up being 3.10.10.

npm install -g npm@3

Or if you want to be specific: npm install -g [email protected]

Hopefully this helps some of you!

Dude, thank you so much!

@aatifkh8n
Copy link

Someone please fix it. I've a project to deploy, waiting for it. Can anyone tell me how to ROLL IT BACK in Ubuntu Linux Distro?

@Rey-17
Copy link

Rey-17 commented Sep 13, 2022

curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
apt -y install nodejs make gcc g++

Yes!! It's works!

works 4 me too !!!

Me too !!!

@wangminqi
Copy link

wangminqi commented Feb 27, 2023

  1. Update nodejs to latest version:
sudo npm install -g n
sudo n latest
  1. Update npm to latest version:
sudo npm install -g npm
  1. Do what @runcible suggested
hash -d npm
  1. Try npm install
npm i

Can confirm this works. Versions after this: Platform: Ubuntu 18.04LTS Node version: v14.5.0 npm version: 6.14.5

This one works (the only one perhaps) for me.
I am using WSL2.
So there are errors during these steps where "Getting GLIBC_2.28 not found" pop up, which can be retry and solved by

sudo apt-get remove nodejs
nvm install 16.15.1

@mitar
Copy link

mitar commented May 1, 2023

At least for Meteor versions:

1.3.4
1.3.4.1
1.3.4.2
1.3.4.3
1.3.4.4
1.3.5.1
1.4
1.4.0.1
1.4.1
1.4.1.1

I realized the problem was that I was installing meteor npm install --save @babel/runtime which are only needed for newer version of Meteor. Skipping that and the issue went away for me.

@gmiller123456
Copy link

Had this issue, resolved it by deleting C:\Users%USERNAME%\AppData\Roaming\npm* directories.

Tried many of the other suggestions, even a uninstall/reinstall of Node did not help.

@MarioVilas
Copy link

Same here. None of the solutions in this thread worked. I can only conclude npm is simply broken.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Information further information is requested Bug thing that needs fixing Needs Discussion is pending a discussion Registry specific to registry implementation
Projects
None yet
Development

No branches or pull requests