Search code examples
node.jslinuxwordpressxamppdivi

Node.js command throwing errors in Ubuntu


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 > [email protected]: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
warning divi-scripts > [email protected]: This loader has been deprecated. Please use eslint-webpack-plugin
warning divi-scripts > [email protected]: Deprecated. Please use https://github.com/webpack-contrib/mini-css-extract-plugin
warning divi-scripts > [email protected]: out of support
warning divi-scripts > [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
warning divi-scripts > @babel/runtime > [email protected]: 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 > [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning divi-scripts > divi-dev-utils > [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning divi-scripts > css-loader > cssnano > autoprefixer > [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning divi-scripts > node-sass > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
warning divi-scripts > node-sass > node-gyp > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
warning divi-scripts > fsevents > [email protected]: 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 > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
warning divi-scripts > grunt-contrib-compress > [email protected]: 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 > [email protected]: support for ECMAScript is superseded by `uglify-js` as of v3.13.0
warning divi-scripts > webpack-dev-server > [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
warning divi-scripts > webpack-dev-server > chokidar > [email protected]: 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 > [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning divi-scripts > node-sass > request > [email protected]: this library is no longer supported
warning divi-scripts > fsevents > node-pre-gyp > request > [email protected]: this library is no longer supported
warning divi-scripts > node-sass > request > [email protected]: 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 > [email protected]: 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 > [email protected]: 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 > [email protected]: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
warning divi-scripts > fsevents > node-pre-gyp > [email protected]: 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 > [email protected]: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
warning divi-scripts > fsevents > node-pre-gyp > [email protected]: 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 > [email protected]: 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 > [email protected]: 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 > [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning divi-scripts > eslint > file-entry-cache > flat-cache > [email protected]: CircularJSON is in maintenance only, flatted is its successor.
warning divi-scripts > fsevents > node-pre-gyp > hawk > [email protected]: 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 > [email protected]: 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 > [email protected]: 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 > [email protected]: 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 > [email protected]: 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 > [email protected]: 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 > [email protected]: 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 > [email protected]: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
warning divi-scripts > svgr > h2x-core > h2x-parse > jsdom > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
warning divi-scripts > webpack > node-libs-browser > url > [email protected]: 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 > [email protected]: 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 > [email protected]: flatten is deprecated in favor of utility frameworks such as lodash.
warning divi-scripts > svgr > h2x-core > h2x-parse > jsdom > [email protected]: 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 > [email protected]: https://github.com/lydell/resolve-url#deprecated
warning divi-scripts > webpack-dev-server > chokidar > braces > snapdragon > source-map-resolve > [email protected]: Please see https://github.com/lydell/urix#deprecated
[2/4] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
error [email protected]: 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.


Solution

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