npmbabel-cli

`npm install @babel/cli` says "WARN deprecated" for four modules. How can I fix these deprecations?


My setup

note: no global installations inside of usr/local.

My problem

I use npm init -y to create my package.json. No problems here.

I use npm install --save-dev @babel/core. No problems here. I get version 7.9.6.

Then when I use npm install --save-dev @babel/cli I am getting back:

npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.

npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.

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

The @babel/cli version is 7.8.4.

My attempts to fix the problem

npm install chokidar@3 gives me the exact same warnings.

npm install chokidar followed by npm install --save-dev @babel/cli gives me the exact same warnings.

npm upgrade chokidar gives me absolutely nothing. The terminal simply starts a new line.

I have installed xcode's command line tools (version 11.4.1 - latest non-beta) and the problem persists.

I uninstalled node.js and npm and then re-installed using nvm. The problem still persists.

I have tried reading through the installation guides and documentation at www.babeljs.io but a lot of information seems to be out of date and/or are contradicting themselves. I can't find any youtube videos that may discuss the problem because they are also out of date. All the posts on stackoverflow.com that even slightly relate to this issue are also out of date. My biggest problem is trying to find information that isn't out of date.

I'm very stuck. I'm struggling to think of what direction to go in next to try and figure out how to fix these deprecation warnings.

Any help would be really appreciated.


Solution

  • As at 7.10.3, Babel requires the deprecated chokidar to provide backward compatibility for Node 6.

    As I understand Babel 8 will drop support for Node 6. Please see the following 2 babel issues for more information on this topic: Babel issue 9981 and Babel issue 10684

    Regarding urix and resolve-url, the Babel source tree references source-map-resolve@0.5.3 which in turn references the deprecated urix and resolve-url.

    As shown in the warning message in your post, the links resolve-url and urix explain that "The solution is to make your dependency chain update to source-map-resolve version 0.6.0 or later, or switch to dependencies not using source-map-resolve at all." however whether you are keen to chance messing with the Babel dependency tree is another story.

    Deprecated however does not mean broken and as you are using Node 12.16.3 and the warnings state failure only from Node 14+ my expectation is that they should still perform as desired in your scenario.