Cli: [BUG] Missing required argument #1

Created on 12 Jan 2020  Β·  55Comments  Β·  Source: npm/cli

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

Bug Community Needs Discussion Question Registry

Most helpful comment

As people stated above looks like node v8.10.0 and npm v3.5.2 are no longer supported. I tried running npm install -g npm@latest but it didn't update my node and npm. If you're using Ubuntu 18.4 make sure you add the node 10 repository

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

All 55 comments

Same here

Same problem here.

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

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

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.

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

@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 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.

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!)

@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.

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.

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: https://github.com/ljharb/json-file-plus/commit/93c227cbf88775352098d1a6b6025b851dac514b that package consistently failed in node 5 on appveyor.

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.

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.

@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.

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?

@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.

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

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>

Same here :(

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

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!

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!

I had the same situation, but it looks like I managed to fix it by upgrading default Node 8 to Node 10 according to the instructions on https://github.com/nodesource/distributions (npm was correspondingly upgraded from 3.5.x to 6.13.4)

:| . So many bugs on new versions of npm

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

@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.

Hi,

Probably the easiest way to prove it is by trying to install *npm install -D load-grunt-config) in my case using node v5.3.0 and npm 3.5.2. Before the "those versions are too old and they don't have support" I'm not trying to install new packages or anything that needs support, I'm just trying to run an old application which happens to be working a couple of months ago but not anymore because something changed apparently.

Thanks for the help.

This is the error btw:

npm ERR! node v5.3.0
npm ERR! npm v3.5.2
npm ERR! code EMISSINGARG

npm ERR! typeerror Error: Missing required argument #1

As people stated above looks like node v8.10.0 and npm v3.5.2 are no longer supported. I tried running npm install -g npm@latest but it didn't update my node and npm. If you're using Ubuntu 18.4 make sure you add the node 10 repository

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

Also not working for me
$ npm --version
3.5.2
$ node --version
v8.10.0

Worked after updating as @ethanplee14 suggested

I can consistently reproduce this issue by calling npm install which-collection when using [email protected]. Updating npm sadly isn't an easy option for me on legacy systems.

A previous version of this package can be installed correctly, e.g. npm install [email protected] works. As far as I can tell, these versions differ with respect to their type field which is undefined for v1.0.0 and set to commonjs for the later version. This triggers a different code path because of https://github.com/npm/cli/blob/56c980266edd12be214033d2e040983b19787808/lib/install/deps.js#L517.

It appears that the check for pkg.type was removed in [email protected] https://github.com/npm/cli/blob/0c5e815d8400b7c778e7013d86a379db28a46a46/lib/install/deps.js#L511 so I'll try to update npm to that version and see if that helps.

Testing this was easier than expected, for me [email protected] indeed works. Alternatively, adding an extra check to https://github.com/npm/cli/blob/56c980266edd12be214033d2e040983b19787808/lib/install/deps.js#L517 like if (pkg.type && (pkg.type !== 'commonjs')) { also seems to solve the problem, at least with my which-collection "test" package. Given that this type field can have many other values, this simple check probably won't suffice.

I was facing the same issue with npm 3.5.2 and node 8.10.0 and got everything right after @ethanplee14 suggestion.

I'm getting the same error using the latest versions of Node and NPM installed following the instructions on digitalocean.com.

https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-18-04

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

What's the prescription to get this sucker working again?

same problem here :(
ubuntu lts 18.04
node v8.10.0
npm v3.5.2

I reported the problem on my blog via this issue.

https://github.com/scripting/Scripting-News/issues/172

And it was solved by installing a newer version of Node and NPM.

Instructions are over there.

Net-net -- Digital Ocean should either update their docs, or their software.

As people stated above looks like node v8.10.0 and npm v3.5.2 are no longer supported. I tried running npm install -g npm@latest but it didn't update my node and npm. If you're using Ubuntu 18.4 make sure you add the node 10 repository

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

Thanks!!!!!! Very good

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!

same issue running on Ubuntu 18.04 LTS.
Tried all the above mentioned methods. None worked

i@support-System-Product-Name:~/Projects/molstar-master$ npm --version
3.5.2
i@support-System-Product-Name:~/Projects/molstar-master$ node --version
v13.10.1

@LivC182 if you're using node 13.x, your npm version should be a LOOOOOT higher.

Seems like this problem is caused by Bash caching the path of the npm command, and can be solved via hash -d npm.

Solved the issue for me running on Ubuntu 18.04 LTS:
https://askubuntu.com/questions/1036278/npm-is-incorrect-version-on-latest-ubuntu-18-04-installation

Omg, i watching this issue since 26 February, and literally no one can explain, how to fix this, lol, it could be legendary thread

  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
  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

When runnig simple npm install all works good.. but when running npm install in a dockerfile, I get this;

npm ERR! Linux 4.14.111-boot2docker
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v6.5.0
npm ERR! npm v3.10.3
npm ERR! code EMISSINGARG

npm ERR! typeerror Error: Missing required argument #1
npm ERR! typeerror at andLogAndFinish (/usr/local/lib/node_modules/npm/lib/fetch-package-metadata.js:31:3)
npm ERR! typeerror at fetchPackageMetadata (/usr/local/lib/node_modules/npm/lib/fetch-package-metadata.js:51:22)
npm ERR! typeerror at resolveWithNewModule (/usr/local/lib/node_modules/npm/lib/install/deps.js:515:12)
npm ERR! typeerror at /usr/local/lib/node_modules/npm/lib/install/deps.js:516:7
npm ERR! typeerror at /usr/local/lib/node_modules/npm/node_modules/iferr/index.js:13:50
npm ERR! typeerror at /usr/local/lib/node_modules/npm/lib/fetch-package-metadata.js:37:12
npm ERR! typeerror at addRequestedAndFinish (/usr/local/lib/node_modules/npm/lib/fetch-package-metadata.js:67:5)
npm ERR! typeerror at returnAndAddMetadata (/usr/local/lib/node_modules/npm/lib/fetch-package-metadata.js:121:7)
npm ERR! typeerror at pickVersionFromRegistryDocument (/usr/local/lib/node_modules/npm/lib/fetch-package-metadata.js:138:20)
npm ERR! typeerror at /usr/local/lib/node_modules/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 info retry fetch attempt 1 at 10:31:16 PM
npm info attempt registry request try #1 at 10:31:16 PM
npm http fetch GET https://registry.npmjs.org/array.prototype.map/-/array.prototype.map-1.0.2.tgz
npm http fetch 200 https://registry.npmjs.org/array.prototype.map/-/array.prototype.map-1.0.2.tgz

npm ERR! Please include the following file with any support request:
npm ERR! /portalv2/npm-debug.log
The command '/bin/sh -c npm install' returned a non-zero code: 1

..already have put RUN npm install -g npm@latest into the dockerfile, right before npm install

please help :(

I ran into this problem on Ubuntu 18.04 (on Windows 10 in WSL).

❌ npm update -g @vlue/cli to to 4.4.6 did not resolve it.
❌ npm update -g npm to 6.13.4 did not resolve it.
βœ” Upgrading node (using nvm) to v12.16.1 (which happens to be the version we are currently using in production) finally resolved it:

nvm install 12.16.1
nvm use 12.16.1

I had to sudo chown -R 1000:1000 "/home/daniel/.npm" along the way, because of a bug of the older npm version used before.

In my case,

npm install -g npm@latest
sudo chown -R $USER:$(id -gn $USER) /home/$USER/.config

Did the trick

After running the update commands, close and reopen your terminal.

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.

βš™οΈ Installing CLI plugins. This might take a while...

loadDep:@ant-design-vue/b ▐ β•’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β•Ÿ
loadDep:source-map β†’ afte β–€ β•’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β•Ÿ
loadDep:fsevents β†’ 304 β–„ β•’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β•Ÿ
loadDep:inquirer β–€ β•’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β•Ÿ
loadDep:through β†’ get β–€ β•’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β•Ÿ
loadDep:webpack-merge β†’ a β–€ β•’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β•Ÿ
loadDep:webpack-merge β†’ m ▐ β•’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β•Ÿ
npm ERR! Linux 5.4.0-42-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "--loglevel" "error"
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

npm ERR! Please include the following file with any support request:
npm ERR! /home/hah/Schreibtisch/vue/contakt/npm-debug.log
ERROR command failed: npm install --loglevel error
it had not solved my problem

@heshamahrabi both node 8 and npm 3 are very obsolete; try npm install -g npm and try again?

Even if you update npm in ubuntu machines the issue might persist due to bash caching the path
Refer to :

https://askubuntu.com/questions/1036278/npm-is-incorrect-version-on-latest-ubuntu-18-04-installation

It did the trick for me πŸ‘

Even if you update npm in ubuntu machines the issue might persist due to bash caching the path
Refer to :

https://askubuntu.com/questions/1036278/npm-is-incorrect-version-on-latest-ubuntu-18-04-installation

It did the trick for me

  • I thank you very much for the quick answer, my problem was exactly, as you described.

a lot of experience, a lot of advice thank you too my friend @ljharb

sudo npm install -g npm@latest
hash -r

Did the trick for me

first become the root user in the terminal by the command "sudo -i"[You will be asked to enter the password] and then run the command " npm install -g npm@latest "

As people stated above looks like node v8.10.0 and npm v3.5.2 are no longer supported. I tried running npm install -g npm@latest but it didn't update my node and npm. If you're using Ubuntu 18.4 make sure you add the node 10 repository

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

Thanks!!!!!! Very good

Thanks worked for me!

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

Yes!! It's works!

I had to upgrade my Ubuntu server from 18 to 20 to make it work

Holy crap, this issue still not closed??? After 10 months and 2 posts about fixing it??

No way.

@HotGreenPeas it's time to close. I can even make PR to edit docs with this problem fixing step by step.

I had an old project which uses node 5.4.1. After installing it with nvm (nvm install 5.4.1), it installed some old version of npm (like 3.x). That version of npm couldn't handle npm i and failed with the same error as in the OP.

What I did was nvm install-latest-npm which installed the latest npm version that's compatible with node 5.4.1, which in this case is 5.3.0.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ahuglajbclajep picture ahuglajbclajep  Β·  3Comments

dr-js picture dr-js  Β·  3Comments

Cohen-Carlisle picture Cohen-Carlisle  Β·  4Comments

jaydenseric picture jaydenseric  Β·  3Comments

theADAMJR picture theADAMJR  Β·  3Comments