React Native course backend inst update?

Hi Mosh People,

As we know, the React Native course is rather outdated. Like some others, I’ve mostly been able to source workarounds. But now, in Feb 2024, does anyone know of the updated workaround to move through Advanced concepts - Networking with the current backend folder as it is.

Running ’ npm i ’ still shows the following error (any help appreciated!):

Using M2 Chip Mac.

scottyschwartz-owen@scottys-mbp-16 Backend % npm i
npm WARN old lockfile 
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile 
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile 
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'done-with-it-backend@1.0.0',
npm WARN EBADENGINE   required: { node: '12.6.x' },
npm WARN EBADENGINE   current: { node: 'v21.6.1', npm: '10.2.4' }
npm WARN EBADENGINE }
npm WARN deprecated ini@1.3.5: Please update to ini >=1.3.6 to avoid a prototype pollution issue
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 deprecated mkdirp@0.5.4: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated fsevents@2.1.2: "Please update to latest v2.3 or v2.2"
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 debug@3.2.6: 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 multer@1.4.2: Multer 1.x is affected by CVE-2022-24434. This is fixed in v1.4.4-lts.1 which drops support for versions of Node.js before 6. Please upgrade to at least Node.js 6 and version 1.4.4-lts.1 of Multer. If you need support for older versions of Node.js, we are open to accepting patches that would fix the CVE on the main 1.x release line, whilst maintaining compatibility with Node.js 0.10.
npm WARN deprecated joi@14.3.1: This module has moved and is now available at @hapi/joi. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
npm ERR! code 1
npm ERR! path /Users/scottyschwartz-owen/Documents/Coding/Coding with Mosh/Courses/React Native Series/2. Advanced Concepts/4. Networking/Backend/node_modules/sharp
npm ERR! command failed
npm ERR! command sh -c (node install/libvips && node install/dll-copy && prebuild-install --runtime=napi) || (node-gyp rebuild && node install/dll-copy)
npm ERR! CC(target) Release/obj.target/nothing/../node-addon-api/src/nothing.o
npm ERR!   LIBTOOL-STATIC Release/nothing.a
npm ERR!   TOUCH Release/obj.target/libvips-cpp.stamp
npm ERR!   CXX(target) Release/obj.target/sharp/src/common.o
npm ERR! info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.9.1/libvips-8.9.1-darwin-arm64v8.tar.gz
npm ERR! ERR! sharp Prebuilt libvips 8.9.1 binaries are not yet available for darwin-arm64v8
npm ERR! info sharp Attempting to build from source via node-gyp but this may fail due to the above error
npm ERR! info sharp Please see https://sharp.pixelplumbing.com/install for required dependencies
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@10.0.1
npm ERR! gyp info using node@21.6.0 | darwin | arm64
npm ERR! gyp info find Python using Python version 3.12.1 found at "/Library/Frameworks/Python.framework/Versions/3.12/bin/python3"
npm ERR! gyp info spawn /Library/Frameworks/Python.framework/Versions/3.12/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'make',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/scottyschwartz-owen/Documents/Coding/Coding with Mosh/Courses/React Native Series/2. Advanced Concepts/4. Networking/Backend/node_modules/sharp/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/scottyschwartz-owen/Library/Caches/node-gyp/21.6.0/include/node/common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=/Users/scottyschwartz-owen/Library/Caches/node-gyp/21.6.0',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/Users/scottyschwartz-owen/Library/Caches/node-gyp/21.6.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/Users/scottyschwartz-owen/Documents/Coding/Coding with Mosh/Courses/React Native Series/2. Advanced Concepts/4. Networking/Backend/node_modules/sharp',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! <string>:84: SyntaxWarning: invalid escape sequence '\/'
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: archive library: Release/nothing.a the table of contents is empty (no object file members in the library define global symbols)
npm ERR! clang: error: no such file or directory: 'with'
npm ERR! clang: error: no such file or directory: 'Mosh/Courses/React'
npm ERR! clang: error: no such file or directory: 'Native'
npm ERR! clang: error: no such file or directory: 'Series/2.'
npm ERR! clang: error: no such file or directory: 'Advanced'
npm ERR! clang: error: no such file or directory: 'Concepts/4.'
npm ERR! clang: error: no such file or directory: 'Networking/Backend/node_modules/node-addon-api'
npm ERR! make: *** [Release/obj.target/sharp/src/common.o] Error 1
npm ERR! gyp ERR! build error 
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:209:23)
npm ERR! gyp ERR! System Darwin 23.3.0
npm ERR! gyp ERR! command "/Users/scottyschwartz-owen/node_modules/node/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /Users/scottyschwartz-owen/Documents/Coding/Coding with Mosh/Courses/React Native Series/2. Advanced Concepts/4. Networking/Backend/node_modules/sharp
npm ERR! gyp ERR! node -v v21.6.0
npm ERR! gyp ERR! node-gyp -v v10.0.1
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in: /Users/scottyschwartz-owen/.npm/_logs/2024-02-11T17_20_19_361Z-debug-0.log
scottyschwartz-owen@scottys-mbp-16 Backend % npm i
npm WARN old lockfile 
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile 
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile 
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'done-with-it-backend@1.0.0',
npm WARN EBADENGINE   required: { node: '12.6.x' },
npm WARN EBADENGINE   current: { node: 'v21.6.1', npm: '10.2.4' }
npm WARN EBADENGINE }
npm WARN deprecated ini@1.3.5: Please update to ini >=1.3.6 to avoid a prototype pollution issue
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 deprecated mkdirp@0.5.4: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated fsevents@2.1.2: "Please update to latest v2.3 or v2.2"
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 debug@3.2.6: 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 multer@1.4.2: Multer 1.x is affected by CVE-2022-24434. This is fixed in v1.4.4-lts.1 which drops support for versions of Node.js before 6. Please upgrade to at least Node.js 6 and version 1.4.4-lts.1 of Multer. If you need support for older versions of Node.js, we are open to accepting patches that would fix the CVE on the main 1.x release line, whilst maintaining compatibility with Node.js 0.10.
npm WARN deprecated joi@14.3.1: This module has moved and is now available at @hapi/joi. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
npm ERR! code 1
npm ERR! path /Users/scottyschwartz-owen/Documents/Coding/Coding with Mosh/Courses/React Native Series/2. Advanced Concepts/4. Networking/Backend/node_modules/sharp
npm ERR! command failed
npm ERR! command sh -c (node install/libvips && node install/dll-copy && prebuild-install --runtime=napi) || (node-gyp rebuild && node install/dll-copy)
npm ERR! CC(target) Release/obj.target/nothing/../node-addon-api/src/nothing.o
npm ERR!   LIBTOOL-STATIC Release/nothing.a
npm ERR!   TOUCH Release/obj.target/libvips-cpp.stamp
npm ERR!   CXX(target) Release/obj.target/sharp/src/common.o
npm ERR! info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.9.1/libvips-8.9.1-darwin-arm64v8.tar.gz
npm ERR! ERR! sharp Prebuilt libvips 8.9.1 binaries are not yet available for darwin-arm64v8
npm ERR! info sharp Attempting to build from source via node-gyp but this may fail due to the above error
npm ERR! info sharp Please see https://sharp.pixelplumbing.com/install for required dependencies
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@10.0.1
npm ERR! gyp info using node@21.6.0 | darwin | arm64
npm ERR! gyp info find Python using Python version 3.12.1 found at "/Library/Frameworks/Python.framework/Versions/3.12/bin/python3"
npm ERR! gyp info spawn /Library/Frameworks/Python.framework/Versions/3.12/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'make',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/scottyschwartz-owen/Documents/Coding/Coding with Mosh/Courses/React Native Series/2. Advanced Concepts/4. Networking/Backend/node_modules/sharp/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/scottyschwartz-owen/Library/Caches/node-gyp/21.6.0/include/node/common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=/Users/scottyschwartz-owen/Library/Caches/node-gyp/21.6.0',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/Users/scottyschwartz-owen/Library/Caches/node-gyp/21.6.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/Users/scottyschwartz-owen/Documents/Coding/Coding with Mosh/Courses/React Native Series/2. Advanced Concepts/4. Networking/Backend/node_modules/sharp',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! <string>:84: SyntaxWarning: invalid escape sequence '\/'
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: archive library: Release/nothing.a the table of contents is empty (no object file members in the library define global symbols)
npm ERR! clang: error: no such file or directory: 'with'
npm ERR! clang: error: no such file or directory: 'Mosh/Courses/React'
npm ERR! clang: error: no such file or directory: 'Native'
npm ERR! clang: error: no such file or directory: 'Series/2.'
npm ERR! clang: error: no such file or directory: 'Advanced'
npm ERR! clang: error: no such file or directory: 'Concepts/4.'
npm ERR! clang: error: no such file or directory: 'Networking/Backend/node_modules/node-addon-api'
npm ERR! make: *** [Release/obj.target/sharp/src/common.o] Error 1
npm ERR! gyp ERR! build error 
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:209:23)
npm ERR! gyp ERR! System Darwin 23.3.0
npm ERR! gyp ERR! command "/Users/scottyschwartz-owen/node_modules/node/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /Users/scottyschwartz-owen/Documents/Coding/Coding with Mosh/Courses/React Native Series/2. Advanced Concepts/4. Networking/Backend/node_modules/sharp
npm ERR! gyp ERR! node -v v21.6.0
npm ERR! gyp ERR! node-gyp -v v10.0.1
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in: /Users/scottyschwartz-owen/.npm/_logs/2024-02-11T17_27_47_142Z-debug-0.log
3 Likes

The issue is with the sharp dependency.

npm ERR! ERR! sharp Prebuilt libvips 8.9.1 binaries are not yet available for darwin-arm64v8

You need to uninstall sharp and then install, like this:

npm remove sharp && npm install sharp

It works on my M1.

Thanks so much for your input. That did not work for me. What did work was following kinganes’ suggestion on this thread:

kinganes

Jan '23

I got it solved like this:

  1. Create new blank folder and open terminal
  2. writ “npm init” and follow the steps in the command line (you have to give ur name and project name and so on)
  3. you install all the dependencies that mosh installed
    → I opened the package.json and looked all the dependencies on GitHub and installed them into the blank folder
    Those are the dependencies that I installed :
    “body-parser”: “^”,
    “compression”: “^”,
    “config”: “^”,
    “expo-server-sdk”: “^”,
    “express”: “^”,
    “helmet”: “^”,
    “joi”: “^”,
    “jsonwebtoken”: “^”,
    “multer”: “^”,
    “sharp”: “^”
  4. After I installed everything I copied (except for the package.json) the files from mosh into the blank folder where I just installed all the node modules
  5. From here you can go on like in the Video → npm I and it should work.

The only error after this was:

(node:92507) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)