降级节点版本或npm版本时,Node JS中出现错误

时间:2018-12-04 14:08:35

标签: node.js node-modules

我在Windows计算机中的应用程序确实仅运行v6.11.0的节点版本,而NPM为3.11.11。

现在,我的节点版本和NPM已升级。我无法下载节点版本和NPM版本。当前节点版本为v10.14.1,npm为5.5.1

当我尝试降级时,我遇到以下错误。

npm install -g node@6.11.0
npm install -g npm@3.10.10
  

以下错误

npm WARN npm npm does not support Node.js v10.14.1
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8.
npm WARN npm You can find the latest version at https://nodejs.org/
WARNING: You are likely using a version of node-tar or npm that is incompatible with this version of Node.js.
Please use either the version of npm that is bundled with Node.js, or a version of npm (> 5.5.1 or < 5.4.0) or node-tar
(> 4.0.1) that is compatible with Node.js 9 and above.
npm[9256]: src\node_zlib.cc:441: Assertion `args.Length() == 7 && "init(windowBits, level, memLevel, strategy, writeResu
lt, writeCallback," " dictionary)"' failed.
 1: 00007FF63013ECF5
 2: 00007FF6301181A6
 3: 00007FF630118271
 4: 00007FF6300740B6
 5: 00007FF630943BA2
 6: 00007FF63094503D
 7: 00007FF630944099
 8: 00007FF630943F7B
 9: 000002EA035DC5C1

关于如何解决我遇到的错误的任何想法。

3 个答案:

答案 0 :(得分:1)

我卸载了当前节点并安装了nvm https://github.com/coreybutler/nvm-windows

答案 1 :(得分:1)

我安装了Node v10.14.1,并在安装软件包时遇到了相同的错误。

我尝试卸载并重新安装;但是并没有解决问题。 Node.js的安装未更新/升级“ npm”版本。

然后我按照以下步骤解决问题。

  1. 转到“ C:\ Users \\ AppData \ Roaming”并删除“ npm”文件夹。
  2. 修复Node.js安装(您也可以重新安装)

我希望这将有助于解决问题。

答案 2 :(得分:1)

npm i -g npm@add version,需要回滚。

例如:npm i -g npm@5.5.1

然后检查您的版本:

npm -v

i-安装 g-全球

相关问题