Npm 不支持 Node.js v9.1.0
您可能应该像我们一样升级到更新版本的节点
Npm 不能保证 npm 可以使用这个版本。
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8.
你可以在 https://nodejs.org/找到最新的版本
警告: 您可能使用了与 Node.js.ng-080b84bf08dd68e5版本不兼容的 node-tar 或 npm 版本。锁定角节点
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.
C: Program Files nodejs node.exe: src node _ zlib. cc: 437: 断言‘ args. Llength () = = 7 & & “ init (windowBits,level,memLevel,policy,writeResult,writeCallback,”“ dictionary)”’失败。
Even though I installed and reinstalled node with brew, with last version 11.8.0, apparently it kept using the last version
fdecollibus$ npm install --global gatsby-cli
npm WARN npm npm does not support Node.js v11.8.0
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, 9.
npm WARN npm You can find the latest version at https://nodejs.org/
/usr/local/Cellar/node/11.8.0/bin/gatsby -> /usr/local/Cellar/node/11.8.0/lib/node_modules/gatsby-cli/lib/index.js
+ gatsby-cli@2.4.8
我在安装其他东西时也遇到过类似的问题。
而且看起来 npm 版本与我的节点版本不兼容。
In my case i had < em > npm 5.4.2 and < em > 节点 v10.15.0
在这个过程的最后,我得到了版本 < em > npm 6.7.0 和 < strong > < em > node v10.5.0
第一个选择:
我降级了节点和其他工具的版本。
在终端上执行下一个命令并安装版本(例如,如果我们需要更改到节点8.14.1)
1.- Npm install -g node@8.14.1
然后执行命令卸载要删除的版本。
2.-Npm uninstall -g node@8.15.0
之后,我们需要执行下一个命令来设置新的路径
3.-Npm update -g node@8.14.1
最后,我们只需要执行版本,就可以看到是否成功地添加了更改
4-Node -v
在这种情况下,我们将看到版本为8.14.1,并且我们完成了这个过程。
If you want do it for Appium and Npm version you can open a new terminal and follow the same steps in order to change the version. For example:
npm WARN npm npm does not support Node.js v10.15.0.
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/
/Users
1. 卸载自制程序:
如果你在 Mac 上,你可能看不到 AppData\Roaming文件夹; 你应该转到 npm root -g并删除 npm_modules文件夹。现在,当您键入 npm --version时,您的计算机应该是混乱的。
2. 重新安装节点:
Try doing brew install node and if you already have node installed, your computer will ask you to reinstall it. If you do brew reinstall node and your versions of brew and npm look good, then you don't need to do the last step!
3. 如果需要链接正确的 Node 版本:
这一步是我认为是我的错,因为我认为我已经安装了节点通过家酿以及实际的在线下载。按照 brew link node后的建议,它应该带你到 brew link --overwrite node。命令将无法覆盖大约7个目录,您都应该使用 sudo rm -rf directory_name删除这些目录。(运用你的常识,不要删除重要的东西。)当您最终能够在没有任何错误的情况下运行 brew link --overwrite node命令之后,您应该执行 brew reinstall node,因为您不再有 npm了。
Tada! You hopefully now have version of npm and node that hopefully can work together.