gpt4 book ai didi

node.js - npm install eslint缺少参数错误

转载 作者:行者123 更新时间:2023-12-03 12:10:54 34 4
gpt4 key购买 nike

我正在尝试在项目文件夹中本地安装eslint。但是按照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,但是出现了相同的错误消息。

npm不会为任何其他软件包(表达,请求等)返回错误。这似乎仅在eslint中发生。

最佳答案

您的npm版本太旧(4岁),您需要对其进行更新

npm i -g npm

还可以考虑更新 node,自2019年12月31日起,版本8为 End-of-life
https://github.com/nodejs/Release

关于node.js - npm install eslint缺少参数错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59701192/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com