Node.js command throwing errors in Ubuntu - node.js

I am attempting to add an additional functionality to the Divi WordPress theme. To do this, I am trying to build an extension to the theme and then a custom module within the extension. Elegant Themes, the developer of Divi, provides a tutorial for creating an extension and also for creating a module within the extension.
My development PC is running XAMPP over Ubuntu 20.04. I followed the tutorials and installed WordPress + Divi. I then installed Node.js by running sudo apt install node and then installed npm by running sudo apt install npm. Next, I ran sudo npm install -g yarn to install Yarn.
The next step called for me to navigate to the plugins folder (/opt/lampp/htdocs/development/wp-content/plugins) of my WordPress site and run npx create-divi-extension development-1.
When I attempted to run this command, I received the following response:
dev#dev:/opt/lampp/htdocs/development/wp-content/plugins$ npx create-divi-extension development-1
npx: installed 174 in 11.696s
Creating a new Divi extension in /opt/lampp/htdocs/development/wp-content/plugins/development-1.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and divi-scripts...
yarn add v1.22.11
info No lockfile found.
[1/4] Resolving packages...
warning divi-scripts > babel-eslint#8.2.2: babel-eslint is now #babel/eslint-parser. This package will no longer receive updates.
warning divi-scripts > eslint-loader#1.9.0: This loader has been deprecated. Please use eslint-webpack-plugin
warning divi-scripts > extract-text-webpack-plugin#3.0.2: Deprecated. Please use https://github.com/webpack-contrib/mini-css-extract-plugin
warning divi-scripts > html-webpack-plugin#2.30.1: out of support
warning divi-scripts > fsevents#1.1.3: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
warning divi-scripts > #babel/runtime > 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.
warning divi-scripts > autoprefixer > browserslist#2.11.3: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning divi-scripts > divi-dev-utils > browserslist#2.11.3: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning divi-scripts > css-loader > cssnano > autoprefixer > browserslist#1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning divi-scripts > node-sass > request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
warning divi-scripts > node-sass > node-gyp > request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
warning divi-scripts > fsevents > node-pre-gyp#0.6.39: Please upgrade to #mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the #mapbox scoped package will recieve updates in the future
warning divi-scripts > fsevents > node-pre-gyp > request#2.81.0: request has been deprecated, see https://github.com/request/request/issues/3142
warning divi-scripts > grunt-contrib-compress > iltorb#2.4.5: The zlib module provides APIs for brotli compression/decompression starting with Node.js v10.16.0, please use it over iltorb
warning divi-scripts > uglifyjs-webpack-plugin > uglify-es#3.3.9: support for ECMAScript is superseded by `uglify-js` as of v3.13.0
warning divi-scripts > webpack-dev-server > chokidar#2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
warning divi-scripts > webpack-dev-server > chokidar > fsevents#1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
warning divi-scripts > css-loader > cssnano > postcss-merge-rules > browserslist#1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning divi-scripts > node-sass > request > har-validator#5.1.5: this library is no longer supported
warning divi-scripts > fsevents > node-pre-gyp > request > har-validator#4.2.1: this library is no longer supported
warning divi-scripts > node-sass > request > uuid#3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
warning divi-scripts > fsevents > node-pre-gyp > request > uuid#3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
warning divi-scripts > webpack-dev-server > sockjs > uuid#3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
warning divi-scripts > node-sass > node-gyp > tar#2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
warning divi-scripts > fsevents > node-pre-gyp > tar#2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
warning divi-scripts > fsevents > node-pre-gyp > tar-pack > tar#2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
warning divi-scripts > fsevents > node-pre-gyp > hawk#3.1.3: This module moved to #hapi/hawk. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
warning divi-scripts > fsevents > node-pre-gyp > request > hawk#3.1.3: This module moved to #hapi/hawk. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
warning divi-scripts > webpack > watchpack > watchpack-chokidar2 > chokidar#2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
warning divi-scripts > css-loader > cssnano > postcss-merge-rules > caniuse-api > browserslist#1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning divi-scripts > eslint > file-entry-cache > flat-cache > circular-json#0.3.3: CircularJSON is in maintenance only, flatted is its successor.
warning divi-scripts > fsevents > node-pre-gyp > hawk > sntp#1.0.9: This module moved to #hapi/sntp. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
warning divi-scripts > fsevents > node-pre-gyp > hawk > cryptiles#2.0.5: 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).
warning divi-scripts > fsevents > node-pre-gyp > hawk > boom#2.10.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).
warning divi-scripts > fsevents > node-pre-gyp > hawk > cryptiles > boom#2.10.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).
warning divi-scripts > fsevents > node-pre-gyp > hawk > hoek#2.16.3: 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).
warning divi-scripts > fsevents > node-pre-gyp > hawk > sntp > hoek#2.16.3: 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).
warning divi-scripts > fsevents > node-pre-gyp > hawk > boom > hoek#2.16.3: 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).
warning divi-scripts > jest > #jest/core > jest-haste-map > sane#4.1.0: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
warning divi-scripts > svgr > h2x-core > h2x-parse > jsdom > request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
warning divi-scripts > webpack > node-libs-browser > url > querystring#0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
warning divi-scripts > babel-jest > babel-plugin-istanbul > istanbul-lib-instrument > babel-template > babel-runtime > 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.
warning divi-scripts > css-loader > cssnano > postcss-merge-rules > postcss-selector-parser > flatten#1.0.3: flatten is deprecated in favor of utility frameworks such as lodash.
warning divi-scripts > svgr > h2x-core > h2x-parse > jsdom > request-promise-native#1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
warning divi-scripts > webpack-dev-server > chokidar > braces > snapdragon > source-map-resolve > resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
warning divi-scripts > webpack-dev-server > chokidar > braces > snapdragon > source-map-resolve > urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
[2/4] Fetching packages...
info fsevents#1.1.3: The platform "linux" is incompatible with this module.
info "fsevents#1.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents#1.2.13: The platform "linux" is incompatible with this module.
info "fsevents#1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents#2.3.2: The platform "linux" is incompatible with this module.
info "fsevents#2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
error grunt-po2mo#0.1.5: The engine "node" is incompatible with this module. Expected version "12.x || 14.x". Got "10.19.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Aborting installation.
yarnpkg add --exact react react-dom divi-scripts --cwd /opt/lampp/htdocs/development/wp-content/plugins/development-1 has failed.
Deleting generated file... package.json
Deleting development-1/ from /opt/lampp/htdocs/development/wp-content/plugins
Done.
When I run node -v I receive v.10.19.0 as a response and when I run npm -v I get 6.14.4.
At this point, this issue is somewhat beyond my expertise and quite confusing to me. All that I can come to understand is that divi-scripts and fsevents are outdated. I'm not sure what those are, what would cause that, or how to fix it.
If someone could provide me with some insight on this issue and some direction in resolving it, it would be much appreciated. Thank you very much.

The issue was a result of not using the correct version of Node and not having the divi-scripts package installed. The fix was simple really.
Step 1: In my home directory, I ran sudo n stable and this updated Node to the latest LTS version.
Step 2: While still in my home directory, I ran npm install divi-scripts. There were still some errors about deprecated dependencies (see here) but it worked.
Step 3: Navigated to my project folder and ran npx create-divi-extension development-1 and it ran successfully, but still with errors about deprecated dependencies for divi-scripts.

Related

EAS engine node is incompatible

I am trying to generate an apk with EAS locally and it gives me an error
Following various answers from stack, I have tried deleting node_modudes, yarn.lock and package.json and running yarn install, but at the end of the process it gives me the same error:
error expo-cli#5.6.0: The engine "node" is incompatible with this module. Expected version ">=12 <=16". Got "18.14.0"
error Found incompatible module.
After upgrading with yarn install I try to build apk with eas build --local and it gives me the following errors:
[INSTALL_DEPENDENCIES] warning #unimodules/core#7.2.0: replaced by the 'expo' package, learn more: https://blog.expo.dev/whats-new-in-expo-modules-infrastructure-7a7cdda81ebc
[INSTALL_DEPENDENCIES] warning expo > uuid#3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
[INSTALL_DEPENDENCIES] warning expo > expo-constants > uuid#3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
[INSTALL_DEPENDENCIES] warning expo > expo-file-system > uuid#3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
[INSTALL_DEPENDENCIES] warning expo > fbemitter > fbjs > core-js#1.2.7: core-js#<3.23.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. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
[INSTALL_DEPENDENCIES] warning expo-cli#5.6.0: No longer supported
[INSTALL_DEPENDENCIES] warning expo-cli > cacache > #npmcli/move-file#1.1.2: This functionality has been moved to #npmcli/fs
[INSTALL_DEPENDENCIES] warning expo-cli > #expo/dev-tools > subscriptions-transport-ws#0.9.8: The `subscriptions-transport-ws` package is no longer maintained. We recommend you use `graphql-ws` instead. For help migrating Apollo software to `graphql-ws`, see https://www.apollographql.com/docs/apollo-server/data/subscriptions/#switching-from-subscriptions-transport-ws For general help using `graphql-ws`, see https://github.com/enisdenjo/graphql-ws/blob/master/README.md
[INSTALL_DEPENDENCIES] warning expo-cli > #expo/dev-tools > graphql-tools#3.0.0: This package has been deprecated and now it only exports makeExecutableSchema.\nAnd it will no longer receive updates.\nWe recommend you to migrate to scoped packages such as #graphql-tools/schema, #graphql-tools/utils and etc.\nCheck out https://www.graphql-tools.com to learn what package you should use instead
[INSTALL_DEPENDENCIES] warning expo-cli > #expo/dev-tools > graphql-tools > uuid#3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
[INSTALL_DEPENDENCIES] warning expo-cli > xdl > webpack-dev-server > chokidar#2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
[INSTALL_DEPENDENCIES] warning expo-cli > xdl > webpack-dev-server > webpack-log > uuid#3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
[INSTALL_DEPENDENCIES] warning expo-cli > xdl > webpack-dev-server > sockjs > uuid#3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
[INSTALL_DEPENDENCIES] warning expo-cli > xdl > webpack-dev-server > url > querystring#0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
[INSTALL_DEPENDENCIES] warning expo-cli > xdl > webpack-dev-server > chokidar > fsevents#1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
[INSTALL_DEPENDENCIES] warning expo-cli > xdl > webpack > micromatch > snapdragon > source-map-resolve#0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
[INSTALL_DEPENDENCIES] warning expo-cli > xdl > webpack > watchpack > watchpack-chokidar2 > chokidar#2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
[INSTALL_DEPENDENCIES] warning expo-cli > xdl > webpack > micromatch > snapdragon > source-map-resolve > source-map-url#0.4.1: See https://github.com/lydell/source-map-url#deprecated
[INSTALL_DEPENDENCIES] warning expo-cli > xdl > webpack > micromatch > snapdragon > source-map-resolve > urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
[INSTALL_DEPENDENCIES] warning expo-cli > xdl > webpack > micromatch > snapdragon > source-map-resolve > resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
[INSTALL_DEPENDENCIES] warning expo-cli > xdl > #expo/webpack-config > optimize-css-assets-webpack-plugin > cssnano > cssnano-preset-default > postcss-svgo > svgo#1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
[INSTALL_DEPENDENCIES] warning expo-cli > xdl > #expo/webpack-config > optimize-css-assets-webpack-plugin > cssnano > cssnano-preset-default > postcss-svgo > svgo > stable#0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
[INSTALL_DEPENDENCIES] warning expo-updates > uuid#3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
[INSTALL_DEPENDENCIES] warning react-native > #react-native-community/cli-platform-ios > xcode > uuid#3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
[INSTALL_DEPENDENCIES] warning react-native > #react-native-community/cli > metro > jest-haste-map > sane#4.1.0: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
[INSTALL_DEPENDENCIES] warning react-native > #react-native-community/cli > metro > metro-minify-uglify > uglify-es#3.3.9: support for ECMAScript is superseded by `uglify-js` as of v3.13.0
[INSTALL_DEPENDENCIES] [2/4] Fetching packages...
[INSTALL_DEPENDENCIES] error expo-cli#5.6.0: The engine "node" is incompatible with this module. Expected version ">=12 <=16". Got "18.14.0"
[INSTALL_DEPENDENCIES] error Found incompatible module.
[INSTALL_DEPENDENCIES] info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
[INSTALL_DEPENDENCIES]
Error: yarn exited with non-zero code: 1
at ChildProcess.completionListener (/private/var/root/.npm/_npx/86c1f166462562ca/node_modules/#expo/spawn-async/build/spawnAsync.js:41:23)
at Object.onceWrapper (node:events:628:26)
at ChildProcess.emit (node:events:513:28)
at maybeClose (node:internal/child_process:1091:16)
at Socket.<anonymous> (node:internal/child_process:449:11)
at Socket.emit (node:events:513:28)
at Pipe.<anonymous> (node:net:322:12)
...
at spawnAsync (/private/var/root/.npm/_npx/86c1f166462562ca/node_modules/#expo/spawn-async/build/spawnAsync.js:7:23)
at spawn (/private/var/root/.npm/_npx/86c1f166462562ca/node_modules/#expo/turtle-spawn/dist/index.js:17:47)
at installDependencies (/private/var/root/.npm/_npx/86c1f166462562ca/node_modules/#expo/build-tools/dist/utils/project.js:107:38)
at async /private/var/root/.npm/_npx/86c1f166462562ca/node_modules/#expo/build-tools/dist/utils/project.js:39:9
at async BuildContext.runBuildPhase (/private/var/root/.npm/_npx/86c1f166462562ca/node_modules/#expo/build-tools/dist/context.js:72:28)
at async setup (/private/var/root/.npm/_npx/86c1f166462562ca/node_modules/#expo/build-tools/dist/utils/project.js:38:5)
at async buildAsync (/private/var/root/.npm/_npx/86c1f166462562ca/node_modules/#expo/build-tools/dist/builders/android.js:19:5)
at async runBuilderWithHooksAsync (/private/var/root/.npm/_npx/86c1f166462562ca/node_modules/#expo/build-tools/dist/builders/common.js:13:13)
at async Object.androidBuilder (/private/var/root/.npm/_npx/86c1f166462562ca/node_modules/#expo/build-tools/dist/builders/android.js:15:12)
at async buildAndroidAsync (/private/var/root/.npm/_npx/86c1f166462562ca/node_modules/eas-cli-local-build-plugin/dist/android.js:62:12)
Build failed
Unknown error. See logs for more information.
Error: npx exited with non-zero code: 1
How can I fix this error to generate the apk? Thank you.

expo init showing Error in downloading and expracting due to TypeError

I installed expo-cli in ubuntu using npm install --global expo-cli and it installed with some warning.
npm WARN deprecated source-map-url#0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated stable#0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
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
npm WARN deprecated source-map-resolve#0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated chokidar#2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated chokidar#2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated querystring#0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated uuid#3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated uuid#3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated uuid#3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated subscriptions-transport-ws#0.9.8: The `subscriptions-transport-ws` package is no longer maintained. We recommend you use `graphql-ws` instead. For help migrating Apollo software to `graphql-ws`, see https://www.apollographql.com/docs/apollo-server/data/subscriptions/#switching-from-subscriptions-transport-ws For general help using `graphql-ws`, see https://github.com/enisdenjo/graphql-ws/blob/master/README.md
npm WARN deprecated svgo#1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm WARN deprecated graphql-tools#3.0.0: This package has been deprecated and now it only exports makeExecutableSchema.\nAnd it will no longer receive updates.\nWe recommend you to migrate to scoped packages such as #graphql-tools/schema, #graphql-tools/utils and etc.\nCheck out https://www.graphql-tools.com to learn what package you should use instead
added 1474 packages, and audited 1475 packages in 15s
121 packages are looking for funding
run `npm fund` for details
26 vulnerabilities (6 moderate, 17 high, 3 critical)
To address issues that do not require attention, run:
npm audit fix
To address all issues (including breaking changes), run:
npm audit fix --force
Run `npm audit` for details.
Then I tried to create a new project using expo init newapp with blank template. But it failed and showing an error log given below
✔ Choose a template: › blank a minimal app as clean as an empty canvas
Error downloading and extracting template package: TypeError: Cannot read properties of null (reading '0')
✖ Something went wrong while downloading and extracting the template.
Can't read JSON file: /home/ntpl/Documents/tutorial/native/newapp/app.json
└─ Cause: Error: ENOENT: no such file or directory, open '/home/ntpl/Documents/tutorial/native/newapp/app.json'
├─ readAsync /usr/local/lib/node_modules/expo-cli/node_modules/#expo/json-file/src/JsonFile.ts:158:13
├─ extractAndPrepareTemplateAppAsync /usr/local/lib/node_modules/expo-cli/src/commands/utils/extractTemplateAppAsync.ts:25:25
└─ actionAsync /usr/local/lib/node_modules/expo-cli/src/commands/initAsync.ts:287:19
Does anyone know how to solve this?
try this:
npm cache clean --force
npm fund
npm audit fix --force
npm i --package-lock-only
npm audit fix --force

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

AWS Elastic Beanstalk fails deployment because of NPM warnings

My elastic beanstalk deployment fails with this log
2021/03/23 14:42:05.458565 [ERROR] An error occurred during execution of command [config-deploy] - [Use NPM to install dependencies]. Stop running the command. Error: Command /bin/sh -c npm --production install failed with error exit status 1. Stderr:npm WARN deprecated babel-eslint#10.1.0: babel-eslint is now #babel/eslint-parser. This package will no longer receive updates.
npm WARN deprecated debug#4.2.0: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797 )
npm WARN deprecated is-hex#1.1.3: Development of this module has been stopped.
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated fsevents#2.1.3: "Please update to latest v2.3 or v2.2"
npm WARN deprecated request#2.16.6: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated debug#4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797 )
npm WARN deprecated har-validator#5.1.5: this library is no longer supported
npm WARN deprecated node-uuid#1.4.8: Use uuid module instead
npm WARN deprecated hawk#0.10.2: This module moved to #hapi/hawk. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
npm WARN deprecated hoek#0.7.6: 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 cryptiles#0.1.3: 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 boom#0.3.8: 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 sntp#0.1.4: This module moved to #hapi/sntp. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
npm WARN deprecated json3#3.2.6: Please use the native JSON object instead of JSON 3
npm WARN deprecated node-uuid#1.4.1: Use uuid module instead
This should not cause the platform to fail the deployment.
Is there a way to override the ELB npm install command to add the --logLevel=error flag.
Still feels like a bug with ELB even if its possible to ignore the warnings somehow.
Ended up using a work around by adding a .npmrc file and added the line --logLevel=error

yarn add react-native whern creating a project via npx

So I have npm 7.5.3 and node v15.8.0 on my ubuntu system. I'm trying to create a react-native project as follows:
npx react-native init Sample
And I get a large error dump with the following description towards the end
Installing react-native...
yarn add v1.16.0
warning ../../../package.json: No license field
info No lockfile found.
[1/4] Resolving packages...
warning react-native > fbjs > core-js#2.6.12: core-js#<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js#3.
warning react-native > fbjs-scripts > core-js#2.6.12: core-js#<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js#3.
warning react-native > #react-native-community/cli > #hapi/joi#15.1.1: Switch to 'npm install joi'
warning react-native > #react-native-community/cli > #hapi/joi > #hapi/address#2.1.4: Moved to 'npm install #sideway/address'
warning react-native > #react-native-community/cli > #hapi/joi > #hapi/bourne#1.3.2: This version has been deprecated and is no longer supported or maintained
warning react-native > #react-native-community/cli > #hapi/joi > #hapi/hoek#8.5.1: This version has been deprecated and is no longer supported or maintained
warning react-native > #react-native-community/cli > #hapi/joi > #hapi/topo#3.1.6: This version has been deprecated and is no longer supported or maintained
warning react-native > #react-native-community/cli > #hapi/joi > #hapi/topo > #hapi/hoek#8.5.1: This version has been deprecated and is no longer supported or maintained
warning react-native > #react-native-community/cli > metro > jest-haste-map > fsevents#1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
warning react-native > #react-native-community/cli > metro > jest-haste-map > micromatch > snapdragon > source-map-resolve > resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
warning react-native > #react-native-community/cli > metro > jest-haste-map > micromatch > snapdragon > source-map-resolve > urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
[2/4] Fetching packages...
info fsevents#1.2.13: The platform "linux" is incompatible with this module.
info "fsevents#1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
error react-native#0.63.4: The engine "node" is incompatible with this module. Expected version ">=10". Got "8.16.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Error: Command failed: yarn add react-native --exact
at checkExecSyncError (node:child_process:681:11)
at execSync (node:child_process:718:15)
at run (/usr/lib/node_modules/react-native-cli/index.js:294:5)
at createProject (/usr/lib/node_modules/react-native-cli/index.js:249:3)
at init (/usr/lib/node_modules/react-native-cli/index.js:200:5)
at Object.<anonymous> (/usr/lib/node_modules/react-native-cli/index.js:153:7)
at Module._compile (node:internal/modules/cjs/loader:1108:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
at Module.load (node:internal/modules/cjs/loader:973:32)
at Function.Module._load (node:internal/modules/cjs/loader:813:14) {
status: 1,
signal: null,
output: [ null, null, null ],
pid: 24544,
stdout: null,
stderr: null
}
Command `yarn add react-native --exact` failed.
npm ERR! code 1
npm ERR! path /home/anton/Documents/front-end
npm ERR! command failed
npm ERR! command sh -c react-native "init" "sample"
npm ERR! A complete log of this run can be found in:
npm ERR! /home/anton/.npm/_logs/2021-02-09T18_06_36_328Z-debug.log
How do I overcome this problem?
edit: I already attempted npm install --save core-js#^3 the error remains the same.

Resources