简体   繁体   中英

Unable to install Expo CLI. (NPM WARN Deprecated)

So, I'm running the following command to install it: I'm using MACOS

npm install -g expo-cli

And this is what I get:

npm WARN deprecated u/hapi/joi@17.1.1: Switch to 'npm install joi'

npm WARN deprecated u/hapi/address@4.1.0: Moved to 'npm install u/sideway/address'

npm WARN deprecated u/hapi/formula@2.0.0: Moved to 'npm install u/sideway/formula'

npm WARN deprecated u/hapi/pinpoint@2.0.0: Moved to 'npm install u/sideway/pinpoint'

npm WARN deprecated core-js@2.6.12: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.

npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142

npm WARN deprecated har-validator@5.1.5: this library is no longer supported

npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated

npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated

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 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).

/Users/lachitbaruah/.npm-global/bin/expo-cli -> /Users/lachitbaruah/.npm-global/lib/node_modules/expo-cli/bin/expo.js

/Users/lachitbaruah/.npm-global/bin/expo -> /Users/lachitbaruah/.npm-global/lib/node_modules/expo-cli/bin/expo.js

npm WARN u/pmmmwh/react-refresh-webpack-plugin@0.3.3 requires a peer of react-refresh@^0.8.2 but none is installed. You must install peer dependencies yourself.

  • expo-cli@4.4.4

updated 14 packages in 102.228s

I have tried almost everything.! But I want the solution for this particular thing.

I found a fix that don't require using yarn or enabling an unsafe flag as of today (12 Mar 2022), and it's all because of this issue: https://github.com/npm/cli/issues/3472

Basically npm can't fix the dependencies (v. 7 or 8), simply run npm install -g npm@6 and continue with the installation process.

On an editorial note, it's pretty insane that a year old bug carried over into 2 majors prevents the installation of something as popular as React Native. I really hope this answer will help people like me who try to get started because I almost abandoned myself.

Try sudo npm install expo-cli -g --unsafe-perm

Run these two commands

sudo npm install npm@latest -g

sudo npm install -g expo-cli

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM