gpt4 book ai didi

node.js - 在 Ubuntu 中安装 npm 包时出错

转载 作者:行者123 更新时间:2023-12-03 12:16:15 26 4
gpt4 key购买 nike

这个问题在这里已经有了答案:





npm install eslint missing argument error

(3 个回答)


2年前关闭。




我有一个项目,以前它工作正常,突然开始显示此错误:-
这是一个使用 create-react-app 创建的 react 项目。npm installnpm -f install 的相同错误

sudipt@sudo:~/Desktop/project/console-frontend$ npm -f install
npm WARN using --force I sure hope you know what you are doing.
npm WARN deprecated popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated fsevents@2.0.6: Please update: there are crash fixes
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm ERR! Linux 5.3.0-46-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "-f" "install"
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/sudipt/Desktop/hydra-python-agent-gui/console-frontend/npm-debug.log

感谢您的帮助

最佳答案

首先,你应该更新你的包:

apt-get update
apt-get -y upgrade

然后在您的项目目录中,删除之前安装的 node_modules 和 package-lock:

例如:
rm -rf node_modules
rm package-lock.json

然后再次安装更新的包:
npm i

鉴于上下文,这是我的建议,我希望这会有所帮助!

关于node.js - 在 Ubuntu 中安装 npm 包时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61127889/

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