NPM and Node.js Version incompatibility

Today, when Xiaobian was installing dependency, he suddenly reported the following error:
. Well, although Xiaobian passed CET-4, he didn’t know which ocean to throw him into, so he went to Baidu to translate.
The result of translation is: the possible node tar or NPM version is the same as node.js This version of is not compatible. Then Xiaobian searches for answers on Baidu, saying that NPM will be downgraded, and the error prompt also says that Xiaobian should mention the version of NPM to be greater than 5.5.1 or less than 5.4.0. However, goose, Xiaobian according to it said downgrade or upgrade operation a wave as fierce as a tiger, the result, ha ha.
So, Xiaobian saw another article on Du Niang. Well, it solved the problem perfectly, so I shared it with you. Xiaobian also took notes.
NPM error

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[12696]: c:\ws\src\node_zlib.cc:568: Assertion `args.Length() == 7 && "init(windowBits, level, memLevel, strategy, writeResult, writeCallback," " dictionary)"' failed. 
 1: 00007FF7EA10363F napi_wrap+128063
 2: 00007FF7EA0A2836 v8::base::CPU::has_sse+35142
 3: 00007FF7EA0A2B53 v8::base::CPU::has_sse+35939
 4: 00007FF7EA021197 v8::internal::Debug::break_frame_id+84983
 5: 00007FF7EA86DBE0 v8::internal::Builtins::builtin_handle+323456
 6: 00007FF7EA86D127 v8::internal::Builtins::builtin_handle+320711
 7: 00007FF7EA86D468 v8::internal::Builtins::builtin_handle+321544
 8: 00007FF7EA86D26E v8::internal::Builtins::builtin_handle+321038
 9: 00007FF7EAD04EDD v8::internal::SetupIsolateDelegate::SetupHeap+546893
10: 00007FF7EAC89D8C v8::internal::SetupIsolateDelegate::SetupHeap+42748
11: 00007FF7EAC85320 v8::internal::SetupIsolateDelegate::SetupHeap+23696
12: 00007FF7EAD695C0 v8::internal::SetupIsolateDelegate::SetupHeap+958256
15: 00007FF7EAC852F7 v8::internal::SetupIsolateDelegate::SetupHeap+23655
16: 00007FF7EAD695C0 v8::internal::SetupIsolateDelegate::SetupHeap+958256
17: 00007FF7EAC89D8C v8::internal::SetupIsolateDelegate::SetupHeap+42748
18: 00007FF7EAC89D8C v8::internal::SetupIsolateDelegate::SetupHeap+42748
19: 00007FF7EAC89D8C v8::internal::SetupIsolateDelegate::SetupHeap+42748
20: 00007FF7EAC830BC v8::internal::SetupIsolateDelegate::SetupHeap+14892
21: 00007FF7EAC89D8C v8::internal::SetupIsolateDelegate::SetupHeap+42748
22: 00007FF7EAC89D8C v8::internal::SetupIsolateDelegate::SetupHeap+42748

Solution:
1. Uninstall node.js2 Delete the NPM and NPM cache (this step can’t be omitted) under C:: (users/administrator/appdata/roaming)
3. Re install nodejs. Please download the installation files from the official website and click here.
Official website address: https://nodejs.org/zh-cn/download/

4. Open the small blackboard and enter node – V and NPM – V respectively to see the corresponding version number

However, the version of nodejs installed by Xiaobian is 12.16.3, and the corresponding version of NPM is 6.14.4. Ah, in this way, Xiaobian reported another error when running NPMI in other projects: exceeding the maximum stack

Maximum call stack size exceeded

Xiaobian asked Du Niang again that the solution is to go back to a lower version of NMP, that is, to downgrade it. Ah, as a result, only the node corresponding to the lower version of NPM can be installed.

Reprint address: https://blog.csdn.net/qq_ 41241767/article/details/89465508

Read More: