gpt4 book ai didi

node.js - 错误消息 "npm ERR! typeerror Error: Missing required argument #2"

转载 作者:太空宇宙 更新时间:2023-11-04 01:47:09 25 4
gpt4 key购买 nike

当我尝试在 Visual Studio 2017 Pro 中通过 package.json 安装或更新 Node.js 包时,收到以下错误消息:

错误

PATH=.\node_modules\.bin;C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Web\External;%PATH%;C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\cmd;C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\mingw32\bin
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Web\External\npm.CMD" install
npm ERR! Windows_NT 10.0.17134
npm ERR! argv "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\Web\\External\\Node.exe" "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\Web\\External\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v5.4.1
npm ERR! npm v3.3.4
npm ERR! code EMISSINGARG
npm ERR! typeerror Error: Missing required argument #2
npm ERR! typeerror at exports.findRequirement (C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Web\External\node_modules\npm\lib\install\deps.js:475:3)
npm ERR! typeerror at C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Web\External\node_modules\npm\lib\install\deps.js:90:19
npm ERR! typeerror at zalgoSafe (C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Web\External\node_modules\dezalgo\dezalgo.js:20:10)
npm ERR! typeerror at finalize (C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Web\External\node_modules\realize-package-specifier\index.js:37:5)
npm ERR! typeerror at C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Web\External\node_modules\realize-package-specifier\index.js:22:20
npm ERR! typeerror at FSReqWrap.oncomplete (fs.js:82:15)
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! C:\Users\Morten\Documents\GitHub\MyProject\src\MyProject\MyProject.Web\npm-debug.log

文件npm-debug.log

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\Web\\External\\Node.exe',
1 verbose cli 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\Web\\External\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install' ]
2 info using npm@3.3.4
3 info using node@v5.4.1
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly install normalizeTree
8 verbose stack Error: Missing required argument #2
8 verbose stack at exports.findRequirement (C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Web\External\node_modules\npm\lib\install\deps.js:475:3)
8 verbose stack at C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Web\External\node_modules\npm\lib\install\deps.js:90:19
8 verbose stack at zalgoSafe (C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Web\External\node_modules\dezalgo\dezalgo.js:20:10)
8 verbose stack at finalize (C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Web\External\node_modules\realize-package-specifier\index.js:37:5)
8 verbose stack at C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Web\External\node_modules\realize-package-specifier\index.js:22:20
8 verbose stack at FSReqWrap.oncomplete (fs.js:82:15)
9 verbose cwd C:\Users\Morten\Documents\GitHub\MyProject\src\MyProject\MyProject.Web
10 error Windows_NT 10.0.17134
11 error argv "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\Web\\External\\Node.exe" "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\Web\\External\\node_modules\\npm\\bin\\npm-cli.js" "install"
12 error node v5.4.1
13 error npm v3.3.4
14 error code EMISSINGARG
15 error typeerror Error: Missing required argument #2
15 error typeerror at exports.findRequirement (C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Web\External\node_modules\npm\lib\install\deps.js:475:3)
15 error typeerror at C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Web\External\node_modules\npm\lib\install\deps.js:90:19
15 error typeerror at zalgoSafe (C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Web\External\node_modules\dezalgo\dezalgo.js:20:10)
15 error typeerror at finalize (C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Web\External\node_modules\realize-package-specifier\index.js:37:5)
15 error typeerror at C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Web\External\node_modules\realize-package-specifier\index.js:22:20
15 error typeerror at FSReqWrap.oncomplete (fs.js:82:15)
15 error typeerror This is an error with npm itself. Please report this error at:
15 error typeerror <http://github.com/npm/npm/issues>
16 verbose exit [ 1, true ]

最佳答案

这是由于 Node.js 和 npm 版本过时造成的。

在 Ubuntu/Debian 系统中使用以下命令更新您的 Node 版本和 npm 版本。

# Using Ubuntu
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -

sudo apt-get install -y nodejs

# Using Debian, as root
curl -sL https://deb.nodesource.com/setup_10.x | bash -

apt-get install -y nodejs

其他操作系统请引用Node.js installation/upgrade .

关于node.js - 错误消息 "npm ERR! typeerror Error: Missing required argument #2",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51012738/

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