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

My setup
MacOS = Catalina 10.15.4 (latest version)
nvm = 0.35.3 (latest version)
node.js = 12.16.3 (latest LTS version). Installed inside of nvm directories.
npm = 6.14.4 (latest version). Installed inside of nvm directories.
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.

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.

Related

Npm Sass Warning

I typed npm install -g sass while installing sass with the command prompt. Gave this error:
npm WARN deprecated fsevents#2.1.3: Please update to v 2.2.x
NPM usually gives these warnings because the maintainers may be using older deprecated dependencies. There's absolutely nothing you can do about this, apart from begging the maintainer to upgrade the dependencies.
Deprecated means that the package/dependency is either:
that which is completely not maintained or
that whose version being used is no longer maintained
Usually these warnings can be ignored, but do remember that the code is still deprecated. If you are the maintainer of any project, you should also upgrade to a newer version.
Hope this helped you :)

What does "npm audit fix" exactly do?

npm audit fix is intended to automatically upgrade / fix vulnerabilities in npm packages. However, I haven't found out what it exactly does to fix those vulnerabilities.
I assumed that npm audit fix would upgrade dependencies and dependencies' dependencies to the latest versions that are allowed by the semver-definitions of the packages – effectively the same as rm package-lock.json; npm install. However npm audit fix still performs a lot of changes after lock file removal + reinstall.
What exactly does npm audit fix do? Does it for example install versions of dependencies newer than those allowed by the corresponding package.json (but still semver-compatible)?
From NPM's site on their audit command:
npm audit fix runs a full-fledged npm install under the hood
And it seems that an audit fix only does semver-compatible upgrades by default. Listed earlier in the document:
Have audit fix install semver-major updates to toplevel dependencies, not just semver-compatible ones:
$ npm audit fix --force
As for the lock file, it is regenerated each time you run a command that changes package.json. There is more information about that in an answer here as well as in the official documentation.
In my understanding is not only "upgrading" but sometimes also downgrading in order to install the stable version that fix the issue, sometimes those issues comes in newer versions that maybe have introduced bugs or simply do not match with previous package's API etc.
E.g in my case for example npm install have upgrade react-script to 5.0.0 that has some issue and after have run:
npm audit fix --force
The force flag does : To address all issues (including breaking changes), run: npm audit fix --force
it installed the 3.0.1 with following message:
npm WARN audit Updating react-scripts to 3.0.1,which is a SemVer major change.
So it does the upgrade to the stable version of that package that fix the issue.
On top, though docs state "is running npm install under the hood" but not in the sense of installing newest version of a dependency, but could be useful also to check what happens with npm ci What is the difference between "npm install" and "npm ci"?

npm install -g expo-cli not completing installation

I am trying to install the expo-cli using nvm but for some reason it will get to a certain point during installation and then just stop.
I have tried using different node versions along with trying to remove the permissions that could of potentially been blocking the installation but still no luck. This is what shows in the console:
npm WARN deprecated joi#14.0.4: This version has been deprecated in accordance with the hapi support policy (hapi.im/sup
port). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable
to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated #babel/polyfill#7.4.4: ? As of Babel 7.4.0, this
npm WARN deprecated package has been deprecated in favor of directly
npm WARN deprecated including core-js/stable (to polyfill ECMAScript
npm WARN deprecated features) and regenerator-runtime/runtime
npm WARN deprecated (needed to use transpiled generator functions):
npm WARN deprecated
npm WARN deprecated > import "core-js/stable";
npm WARN deprecated > import "regenerator-runtime/runtime";
npm WARN deprecated joi#11.4.0: This version has been deprecated in accordance with the hapi support policy (hapi.im/sup
port). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable
to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated topo#2.0.2: This version has been deprecated in accordance with the hapi support policy (hapi.im/sup
port). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable
to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated hoek#4.2.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/sup
port). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable
to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated topo#3.0.3: This module has moved and is now available at #hapi/topo. Please update your dependencie
s as this version is no longer maintained an may contain bugs and security issues.
npm WARN deprecated hoek#6.1.3: This module has moved and is now available at #hapi/hoek. Please update your dependencie
s as this version is no longer maintained an may contain bugs and security issues.
npm WARN tarball tarball data for #expo/traveling-fastlane-linux#1.9.11 (sha512-xCHnqKfwWYygQfRbi9MGNSG28EHKDtzMB+QDklSH
1GeD90TA0beAjlNF+Z+KPxj28s3WZlQr9yw1AqBS7aipcw==) seems to be corrupted. Trying one more time.
Which terminal are you using ? If it's GitBash so the issue arises there try using any other terminal and it works.
I had this exact same problem ("tarball data for #expo/traveling-fastlane-linux#1.9.11 seems to be corrupted") on the command line (instead of powershell) on Windows 10, and running cmd as administrator solved the issue.
I have the same problem. It looks like is a permission issue. Following the documentation I reinstall npm with a node version manager. As I'm a linux user, I use nvm (check the documentation to chose the adequate manager for your system).
After uninstalled both npm and node, I ran:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.1/install.sh | bash
Check installation using:
command -v nvm
The output must be nvm.
Finally, run:
npm install -g expo-cli

tried to install expo as "npm install expo-cli --global" but getting many errors

tried installing using yarn also not worked.. please anyone help me with this..
Your environment has been set up for using Node.js 10.16.1 (x64) and npm.
C:\Windows\System32>npm install expo-cli --global
npm WARN deprecated joi#14.0.4: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated #babel/polyfill#7.4.4: � As of Babel 7.4.0, this
npm WARN deprecated package has been deprecated in favor of directly
npm WARN deprecated including core-js/stable (to polyfill ECMAScript
npm WARN deprecated features) and regenerator-runtime/runtime
npm WARN deprecated (needed to use transpiled generator functions):
npm WARN deprecated
npm WARN deprecated > import "core-js/stable";
npm WARN deprecated > import "regenerator-runtime/runtime";
npm WARN deprecated joi#11.4.0: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated topo#2.0.2: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated hoek#4.2.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated hoek#6.1.3: This module has moved and is now available at #hapi/hoek. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
npm WARN deprecated topo#3.0.3: This module has moved and is now available at #hapi/topo. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
npm WARN tarball tarball data for #expo/traveling-fastlane-darwin#1.9.11 (sha512-nvZSe2FI8cFcv27uosrmjIhfwbuClG+rbMe9OswsdhIVaJkYvF8LN8gIJ/Fsi2S+20GQizxjC11DFq++MOCm+w==) seems to be corrupted. Trying one more time.
Terminate batch job (Y/N)? y
Warning does not cause any problems with your installation. If there is no error, it is installed normally.
I experienced the same problem since yesterday. My solution is to use some of the installation instructions for React Native CLI Quickstart:
install Chocolatey from here. If using windows, run the install instruction from command prompt as Administrator.
Next, if you already have node.js installed, run this line : choco install install python2 jdk8. If not, run choco install -y nodejs.install python2 jdk8. If using windows, run it from command prompt as Administrator.
Run this line : npm install -g react-native-cli
and at last, run that line where you previously stuck : npm install -g expo-cli. This works for me, hopefully works for you.
If you are using mac then follow these steps
go to the home of your terminal and run this cmd
open .npmrc
Check if you have the below line, then remove the below line it and save the file
prefix=/Users/yourname/.nvm/versions/node/v6.11.2
then run
npm install expo-cli --global
expo init my-new-project
These steps solved my issue installing Expo CLI globally.
I hope this help.
Try Installing every dependency listed in that error message
=> npm install -g #hapi/hapi
visit hapi.dev
update the #hapi dependency i just did that now and it has reduced th errors but you will need to find all the errors listed on your own command line

Peer dependency errors from npm even though actual dependency version correctly follows semver

I'm getting npm ERR! invalid errors when I try npm ls or npm install, and it seems like npm is incorrectly thinking peers have incompatible versions. A good example (I get several of these at a time):
npm WARN unmet dependency /MYLOCALPROJECTDIRECTORY/node_modules/grunt-contrib-imagemin/node_modules/imagemin/node_modules/imagemin-gifsicle requires image-type#'^0.1.1' but will load
npm WARN unmet dependency /MYLOCALPROJECTDIRECTORY/node_modules/grunt-contrib-imagemin/node_modules/imagemin/node_modules/image-type,
npm WARN unmet dependency which is version 0.1.4
According to the rules of semver, the caret "^" operator should match a requirement of ^0.1.1 with an actual dependency of version 0.1.4 just fine.
I've installed Node v0.10.30 with npm v1.4.23 using Homebrew (both the latest stables), running OS X Mountain Lion. I'd appreciate tips on finding how to reliably reproduce this - last time I totally uninstalled/reinstalled Node and npm, same local npm modules and everything, and could not find the error again. Came back to work the next day, tried to install some grunt plugin, and ran into all these errors again.
If you happen to reproduce it, I bet you can solve it by removing the node_modules folder, cleaning the cache and reinstalling:
rm -rf ./node_modules
npm cache clean
npm install
I know this is not an actual answer, but I guess it's better than uninstalling/reinstalling node/npm.