npm install eslint缺少参数错误 [英] npm install eslint missing argument error

查看:1548
本文介绍了npm install eslint缺少参数错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在项目文件夹中本地安装eslint。但是,如 https://eslint.org

Am trying to install eslint locally in a project folder. However installing as mentioned on https://eslint.org

npm install eslint --save-dev

返回以下错误:

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

我尝试全局安装eslint,并且也没有将依赖项保存到package.json,但是出现了相同的错误消息。

I have tried installing eslint globally, and also without saving the dependency to package.json but the same error message appears.

npm不会为任何其他软件包(快递,请求等)返回错误。

npm doesn't return an error for any other package (express, request etc.). This seems to be happening only with eslint.

推荐答案

您的npm版本太旧(4岁),您需要更新它

Your npm version is too old (4 years old), you need to update it

npm i -g npm

还可以考虑更新节点,版本31自31起已为报废 2019年12月。
https://github.com/nodejs/Release

Also consider updating node, version 8 is End-of-life since 31 Decembre 2019. https://github.com/nodejs/Release

这篇关于npm install eslint缺少参数错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆