问题
Am trying to install eslint locally in a project folder. However installing as mentioned on https://eslint.org
npm install eslint --save-dev
returns the following error:
npm ERR! Linux 4.15.0-70-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "eslint" "--save-dev"
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/ashish/Documents/Web-Development/Bootcamp/auth-test/npm-debug.log
I have tried installing eslint globally, and also without saving the dependency to package.json but the same error message appears.
npm doesn't return an error for any other package (express, request etc.). This seems to be happening only with eslint.
回答1:
Your npm version is too old (4 years old), you need to update it
npm i -g npm
Also consider updating node
, version 8 is End-of-life
since 31 Decembre 2019.
https://github.com/nodejs/Release
来源:https://stackoverflow.com/questions/59701192/npm-install-eslint-missing-argument-error