umnil / bci-app

BSD 2-Clause "Simplified" License
1 stars 1 forks source link

Terminal Mac OS Issue #16

Open ogbark opened 1 month ago

ogbark commented 1 month ago

This is the error I keep getting, any advice on how to fix would be greatly appreciated:

% npm install
npm warn deprecated @npmcli/move-file@2.0.1: This functionality has been moved to @npmcli/fs
npm warn deprecated gauge@4.0.4: This package is no longer supported.
npm warn deprecated npmlog@6.0.2: This package is no longer supported.
npm warn deprecated are-we-there-yet@3.0.1: This package is no longer supported.
npm warn deprecated consolidate@0.15.1: Please upgrade to consolidate v1.0.0+ as it has been modernized with several long-awaited fixes implemented. Maintenance is supported by Forward Email at https://forwardemail.net ; follow/watch https://github.com/ladjs/consolidate for updates and release changelog
npm warn deprecated read-package-json@6.0.4: This package is no longer supported. Please use @npmcli/package-json instead.
npm warn deprecated q@1.5.1: You or someone you depend on is using Q, the JavaScript Promise library that gave JavaScript developers strong feelings about promises. They can almost certainly migrate to the native JavaScript promise now. Thank you literally everyone for joining me in this bet against the odds. Be excellent to each other.
npm warn deprecated
npm warn deprecated (For a CapTP with native promises, see @endo/eventual-send and @endo/captp)
npm warn deprecated osenv@0.1.5: This package is no longer supported.
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated rimraf@2.7.1: Rimraf versions prior to v4 are no longer supported
npm warn deprecated source-map-resolve@0.6.0: See https://github.com/lydell/source-map-resolve#deprecated
npm warn deprecated webpack-chain@6.5.1: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated vue@2.7.16: Vue 2 has reached EOL and is no longer actively maintained. See https://v2.vuejs.org/eol/ for more details.
npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
npm warn deprecated glob@6.0.4: Glob versions prior to v9 are no longer supported
npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
npm warn deprecated rimraf@2.6.3: Rimraf versions prior to v4 are no longer supported
npm warn deprecated osenv@0.1.4: This package is no longer supported.
npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
npm warn deprecated glob@8.1.0: Glob versions prior to v9 are no longer supported
npm warn deprecated buffer@5.0.2: This version of 'buffer' is out-of-date. You must update to v5.0.8 or newer
npm error code 1
npm error path /Users/oliviabark/Desktop/terminal/node_modules/msgpack
npm error command failed
npm error command sh -c node-gyp rebuild
npm error CC(target) Release/obj.target/libmsgpack/deps/msgpack/objectc.o
npm error   CC(target) Release/obj.target/libmsgpack/deps/msgpack/unpack.o
npm error   CC(target) Release/obj.target/libmsgpack/deps/msgpack/vrefbuffer.o
npm error   CC(target) Release/obj.target/libmsgpack/deps/msgpack/zone.o
npm error   CC(target) Release/obj.target/libmsgpack/deps/msgpack/version.o
npm error   LIBTOOL-STATIC Release/msgpack.a
npm error   CXX(target) Release/obj.target/msgpackBinding/src/msgpack.o
npm error gyp info it worked if it ends with ok
npm error gyp info using node-gyp@10.2.0
npm error gyp info using node@20.15.0 | darwin | arm64
npm error gyp info find Python using Python version 3.9.6 found at "/Library/Developer/CommandLineTools/usr/bin/python3"
npm error gyp http GET https://nodejs.org/download/release/v20.15.0/node-v20.15.0-headers.tar.gz
npm error gyp http 200 https://nodejs.org/download/release/v20.15.0/node-v20.15.0-headers.tar.gz
npm error gyp http GET https://nodejs.org/download/release/v20.15.0/SHASUMS256.txt
npm error gyp http 200 https://nodejs.org/download/release/v20.15.0/SHASUMS256.txt
npm error gyp info spawn /Library/Developer/CommandLineTools/usr/bin/python3
npm error gyp info spawn args [
npm error gyp info spawn args '/Users/oliviabark/Desktop/terminal/node_modules/node-gyp/gyp/gyp_main.py',
npm error gyp info spawn args 'binding.gyp',
npm error gyp info spawn args '-f',
npm error gyp info spawn args 'make',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/Users/oliviabark/Desktop/terminal/node_modules/msgpack/build/config.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/Users/oliviabark/Desktop/terminal/node_modules/node-gyp/addon.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/common.gypi',
npm error gyp info spawn args '-Dlibrary=shared_library',
npm error gyp info spawn args '-Dvisibility=default',
npm error gyp info spawn args '-Dnode_root_dir=/Users/oliviabark/Library/Caches/node-gyp/20.15.0',
npm error gyp info spawn args '-Dnode_gyp_dir=/Users/oliviabark/Desktop/terminal/node_modules/node-gyp',
npm error gyp info spawn args '-Dnode_lib_file=/Users/oliviabark/Library/Caches/node-gyp/20.15.0/<(target_arch)/node.lib',
npm error gyp info spawn args '-Dmodule_root_dir=/Users/oliviabark/Desktop/terminal/node_modules/msgpack',
npm error gyp info spawn args '-Dnode_engine=v8',
npm error gyp info spawn args '--depth=.',
npm error gyp info spawn args '--no-parallel',
npm error gyp info spawn args '--generator-output',
npm error gyp info spawn args 'build',
npm error gyp info spawn args '-Goutput_dir=.'
npm error gyp info spawn args ]
npm error gyp info spawn make
npm error gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm error In file included from ../src/msgpack.cc:1:
npm error In file included from /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8.h:24:
npm error In file included from /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8-array-buffer.h:12:
npm error In file included from /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8-local-handle.h:12:
npm error /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8-internal.h:465:30: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm error SHARED_EXTERNAL_POINTER_TAGS(CHECK_SHARED_EXTERNAL_POINTER_TAGS)
npm error                              ^
npm error /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8-internal.h:465:30: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm error /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8-internal.h:465:30: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm error /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8-internal.h:465:30: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm error /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8-internal.h:465:30: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm error /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm error PER_ISOLATE_EXTERNAL_POINTER_TAGS(CHECK_NON_SHARED_EXTERNAL_POINTER_TAGS)
npm error                                   ^
npm error /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm error /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm error /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm error /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm error /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm error /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm error /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm error /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm error /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm error /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm error /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8-internal.h:466:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm error /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8-internal.h:693:61: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm error     static_assert(kJSObjectType + 1 == kFirstJSApiObjectType);
npm error                                                             ^
npm error                                                             , ""
npm error /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8-internal.h:694:55: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm error     static_assert(kJSObjectType < kLastJSApiObjectType);
npm error                                                       ^
npm error                                                       , ""
npm error /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8-internal.h:695:63: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm error     static_assert(kFirstJSApiObjectType < kLastJSApiObjectType);
npm error                                                               ^
npm error                                                               , ""
npm error /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8-internal.h:893:50: error: 'T' does not refer to a value
npm error             !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
npm error                                                  ^
npm error /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8-internal.h:890:17: note: declared here
npm error template <class T>
npm error                 ^
npm error /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8-internal.h:893:38: error: no member named 'remove_cv_t' in namespace 'std'
npm error             !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
npm error                                 ~~~~~^
npm error /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8-internal.h:893:52: error: expected '(' for function-style cast or type construction
npm error             !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
npm error              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
npm error /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8-internal.h:893:63: error: no member named 'Perform' in the global namespace
npm error             !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
npm error                                                             ~~^
npm error In file included from ../src/msgpack.cc:1:
npm error In file included from /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8.h:24:
npm error In file included from /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8-array-buffer.h:13:
npm error In file included from /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8-object.h:9:
npm error /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8-maybe.h:106:27: error: no template named 'enable_if_t' in namespace 'std'
npm error   template <class U, std::enable_if_t<!std::is_lvalue_reference_v<U>>*>
npm error                      ~~~~~^
npm error /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8-maybe.h:106:45: error: no template named 'is_lvalue_reference_v' in namespace 'std'; did you mean 'is_lvalue_reference'?
npm error   template <class U, std::enable_if_t<!std::is_lvalue_reference_v<U>>*>
npm error                                        ~~~~~^~~~~~~~~~~~~~~~~~~~~
npm error                                             is_lvalue_reference
npm error /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_reference.h:24:29: note: 'is_lvalue_reference' declared here
npm error struct _LIBCPP_TEMPLATE_VIS is_lvalue_reference : _BoolConstant<__is_lvalue_reference(_Tp)> {};
npm error                             ^
npm error In file included from ../src/msgpack.cc:1:
npm error In file included from /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8.h:24:
npm error In file included from /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8-array-buffer.h:13:
npm error In file included from /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8-object.h:9:
npm error /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8-maybe.h:106:69: error: expected '(' for function-style cast or type construction
npm error   template <class U, std::enable_if_t<!std::is_lvalue_reference_v<U>>*>
npm error                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
npm error /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8-maybe.h:123:25: error: no template named 'enable_if_t' in namespace 'std'
npm error template <class T, std::enable_if_t<!std::is_lvalue_reference_v<T>>* = nullptr>
npm error                    ~~~~~^
npm error /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8-maybe.h:123:43: error: no template named 'is_lvalue_reference_v' in namespace 'std'; did you mean 'is_lvalue_reference'?
npm error template <class T, std::enable_if_t<!std::is_lvalue_reference_v<T>>* = nullptr>
npm error                                      ~~~~~^~~~~~~~~~~~~~~~~~~~~
npm error                                           is_lvalue_reference
npm error /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__type_traits/is_reference.h:24:29: note: 'is_lvalue_reference' declared here
npm error struct _LIBCPP_TEMPLATE_VIS is_lvalue_reference : _BoolConstant<__is_lvalue_reference(_Tp)> {};
npm error                             ^
npm error In file included from ../src/msgpack.cc:1:
npm error In file included from /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8.h:24:
npm error In file included from /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8-array-buffer.h:13:
npm error In file included from /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8-object.h:9:
npm error /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8-maybe.h:123:67: error: expected '(' for function-style cast or type construction
npm error template <class T, std::enable_if_t<!std::is_lvalue_reference_v<T>>* = nullptr>
npm error                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
npm error In file included from ../src/msgpack.cc:1:
npm error In file included from /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8.h:33:
npm error In file included from /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8-function.h:11:
npm error /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8-function-callback.h:151:66: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm error                 kReturnValueDefaultValueIndex - kReturnValueIndex);
npm error                                                                  ^
npm error                                                                  , ""
npm error /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8-function-callback.h:153:50: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm error                 kIsolateIndex - kReturnValueIndex);
npm error                                                  ^
npm error                                                  , ""
npm error In file included from ../src/msgpack.cc:2:
npm error /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/node.h:692:8: error: no template named 'optional' in namespace 'std'
npm error   std::optional<std::string> builder_script_path;
npm error   ~~~~~^
npm error 22 warnings and 11 errors generated.
npm error make: *** [Release/obj.target/msgpackBinding/src/msgpack.o] Error 1
npm error gyp ERR! build error 
npm error gyp ERR! stack Error: `make` failed with exit code: 2
npm error gyp ERR! stack at ChildProcess.<anonymous> (/Users/oliviabark/Desktop/terminal/node_modules/node-gyp/lib/build.js:216:23)
npm error gyp ERR! System Darwin 23.2.0
npm error gyp ERR! command "/usr/local/bin/node" "/Users/oliviabark/Desktop/terminal/node_modules/.bin/node-gyp" "rebuild"
npm error gyp ERR! cwd /Users/oliviabark/Desktop/terminal/node_modules/msgpack
npm error gyp ERR! node -v v20.15.0
npm error gyp ERR! node-gyp -v v10.2.0
npm error gyp ERR! not ok

npm error A complete log of this run can be found in:
kevincar commented 1 month ago

@ogbark

The Problem

If you have ever used python, you may be familiar that pip is used to install python packages. Similarly, npm is the tool to install packages for node.

This line: npm error path /Users/oliviabark/Desktop/terminal/node_modules/msgpack, indicates that the problem is with a packages called msgpack, or Message Pack. The problem is that this software is built with C++ and is compiled to node libraries but not the right C++ options:

npm error /Users/oliviabark/Library/Caches/node-gyp/20.15.0/include/node/v8-internal.h:893:38: error: no member named 'remove_cv_t' in namespace 'std'
npm error             !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);

These two lines show that the C++ complier is complaining that it doesn't know what remove_cv_t is. If you look in the C++ documentation for remove_cv, you'll see that remove_cv was introduced in C++ version 2011 (aka c++11), and remove_cv_t was introduced in C++ 2014 (aka c++14). Node is trying to build the package using c++11, but needs at least c++14.

Possible Solutions

There are two methods you can use to try and solve this

Method 1: binding.gyp

Node Gyp has a configuration file called binding.gyp where these settings can be adjusted. You can find this file in the folder for msgpack, for you that would be located here: /Users/oliviabark/Desktop/terminal/node_modules/msgpack/binding.gyp. You can then find and replace all occurrences of c++11 with c++14 or higher (e.g., c++17), then try installing again.

Method 2: environment variables

The first method may not work because the msg pack library is stored in node_modules which may get overwritten when you try to npm install again.

C++ compilers consider environment variables. You can set the appropriate variable like this:

export CXXFLAGS=c++14

Then try running

ogbark commented 3 weeks ago

Finally figured out that I don't think the npm install is actually installing correctly as there is no node_modules in my folder that contains the package.json that should be there once "npm install" is fully installed, working to correct that now and then further correcting the errors.

ogbark commented 3 weeks ago

NPM INSTALL ISSUE:

If anyone else cannot get the node_modules folder this is how I resolved it:

I was now able to install npm install fully so that it gave me the node_modules. First, I moved my terminal folder out of my iCloud Drive and into my documents, copied that path, and pasted into terminal saying: cd /path../terminal. Then, I needed to go through some permissions, which I had to force using: npm cache clean --force. Then I ensured that the paths were correct by running: cd ~/path.../terminal. followed by: ls. After running "ls" it should display the contents inside the terminal folder which should contain package.json. Still had ownership issues and to resolve this I ran: sudo chown -R $(id -u):$(id -g) ~/.npm. Followed by: ls -ld ~/.npm. Then reran the clear cache-force command. Then I had to ensure that nvm was installed so I could run a command allowing for a different version of node.js, v10.24.1 (npm v6.14.12).

Then I ran npm install which got the node_modules folder. However, this did not include the msgpack folder because python is not installed in my path, so using: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)", I added Homebrew to my path and followed the "Next Steps" that it told me, which was running 2 more commands. I followed this up by double checking that it was installed using: brew --version, which displayed the current version of Homebrew. Now to install python using Homebrew I ran: brew install python, followed by: npm install msgpack. This came with errors because of the node.gyp.

Updated current status: Still trying to get the msgpack. Even though I downloaded python in my path it is python 3, but in order to get the msgpack it's saying I need python 2 for the node-gyp that the folder requires. Did not work when I then tried to download python2, so I am trying to find a way to make it work with python3 so I can get the msgpack folder to open the binding.gyp file to change the C++ versions to then run the next line of README code in terminal.

Update: I manually tried to install the msgpack, so I now see a "msgpack-node" folder inside the folder where my "node-modules" and "package.json" are also located. Inside this msgpack-node folder, I see the binding.gyp file, but I currently don't have an application on my Mac to open that file to then change the C++ versions.

Update: Opened the TextEdit application on my Mac then opened the binding.gyp file from there and changed all C++11 to C++17 --< Reran the command in the terminal: npm install. NO MORE ERRORS!!!

Currently running the commands in the README after npm install.

ogbark commented 3 weeks ago

NS RUN ISSUE (next line of code after npm install):

Command was not found --> How I am resolving this: Run:

npm install -g nativescript
sudo gem install xcodeproj
sudo gem install cocoapods
ns run 

Still getting errors.

kevincar commented 3 weeks ago

@ogbark

Thanks for documenting your process. A couple comments:

  1. You mention you had stuff in iCloud drive. Storing these projects in a remote server like iCloud Drive, Google Drive, or Box, etc, can be problematic. Mainly because these services tend to something called file eviction, which means, even though the file is the folder, the file can be un-downloaded, meaning the file contents have been temporarily removed, and redownloading it can slow processes down. Almost always more preferable to have your code live inside a non-cloud folder directly on your computer.

  2. You mention you're still getting errors? What errors are you getting now?

ogbark commented 2 weeks ago

Ever since I started storing outside of the cloud it has been working much better. Im trying to still get the second line of code to run and when I wrote the codes to install cocoa pods and xcodeproj, I had no errors. So, when I tried to do "ns run" I ran into these errors that are saying the opposite of what I just achieved:

✔ xcodeproj is installed and is configured properly. ✔ CocoaPods update is not required. ✔ Your current CocoaPods version is newer than 1.0.0. ✔ Python installed and configured correctly. ✖ WARNING: Xcode is not installed or is not configured properly. You will not be able to build your projects for iOS or run them in the iOS Simulator. To be able to build for iOS and run apps in the native emulator, verify that you have installed Xcode.

✖ WARNING: CocoaPods is not installed or is not configured properly. You will not be able to build your projects for iOS if they contain plugin with CocoaPod file. To be able to build such projects, verify that you have installed CocoaPods (sudo gem install cocoapods).

Your environment is not configured properly and you will not be able to execute local builds. Verify that your environment is configured according to the system requirements described at https://docs.nativescript.org/setup/macos#setting-up-macos-for-ios.

ogbark commented 2 weeks ago

Got rid of all the errors so that the "ns run iOS" is working successfully. What I did to resolve is actually download Xcode from the App Store onto my Mac and then run the Xcode install code, and, for cocoa pods, I had to install Ruby (Ensure you download version 2.6.0, not 2.6.10 or else it will not work). Getting no errors with both of those installations, I verified the versions of them, and then I ran the ns run iOS code where it then searches for a device... I do not have time to test it with my mobile device today, but I will soon and post an update about how that works.

ogbark commented 1 week ago

I was able to install both Xcode and cocoalpods successfully but now when I run "ns build ios" or "ns run iOS" I get these errors:

bci-app % ns build ios
npm warn deprecated @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs
npm warn deprecated stringify-package@1.0.1: This module is not used anymore, and has been replaced by @npmcli/package-json
npm warn deprecated har-validator@5.1.5: this library is no longer supported
npm warn deprecated libnpmconfig@1.2.1: This module is not used anymore. npm config is parsed by npm itself and by @npmcli/config
npm warn deprecated date-format@3.0.0: 3.x is no longer supported. Please upgrade to 4.x or higher.
npm warn deprecated date-format@2.1.0: 2.x is no longer supported. Please upgrade to 4.x or higher.
npm warn deprecated formidable@1.2.6: Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau
npm warn deprecated xmldom@0.1.31: Deprecated due to CVE-2021-21366 resolved in 0.5.0
npm warn deprecated xmldom@0.1.31: Deprecated due to CVE-2021-21366 resolved in 0.5.0
npm warn deprecated xmldom@0.1.31: Deprecated due to CVE-2021-21366 resolved in 0.5.0
npm warn deprecated socks@1.1.10: If using 2.x branch, please upgrade to at least 2.1.6 to avoid a serious bug with socket data flow and an import issue introduced in 2.1.0
npm warn deprecated socks@1.1.10: If using 2.x branch, please upgrade to at least 2.1.6 to avoid a serious bug with socket data flow and an import issue introduced in 2.1.0
npm warn deprecated xmldom@0.3.0: Deprecated due to CVE-2021-21366 resolved in 0.5.0
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 streamroller@2.2.4: 2.x is no longer supported. Please upgrade to 3.x or higher.
npm warn deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm warn deprecated superagent@3.8.3: Please upgrade to v7.0.2+ of superagent.  We have fixed numerous issues with streams, form-data, attach(), filesystem errors not bubbling up (ENOENT on attach()), and all tests are now passing.  See the releases tab for more information at <https://github.com/visionmedia/superagent/releases>.
npm warn deprecated axios@0.18.0: Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410
npm error code 7
npm error path /Users/oliviabark/Documents/terminal/bci-app/node_modules/msgpack
npm error command failed
npm error command sh -c node-gyp rebuild
npm error gyp info it worked if it ends with ok
npm error gyp info using node-gyp@7.1.2
npm error gyp info using node@20.16.0 | darwin | arm64
npm error gyp info find Python using Python version 3.12.5 found at "/opt/homebrew/opt/python@3.12/bin/python3.12"
npm error gyp ERR! UNCAUGHT EXCEPTION 
npm error gyp ERR! stack TypeError: Cannot assign to read only property 'cflags' of object '#<Object>'
npm error gyp ERR! stack     at createConfigFile (/Users/oliviabark/Documents/terminal/bci-app/node_modules/node-gyp/lib/configure.js:117:21)
npm error gyp ERR! stack     at /Users/oliviabark/Documents/terminal/bci-app/node_modules/node-gyp/lib/configure.js:84:9
npm error gyp ERR! stack     at FSReqCallback.oncomplete (node:fs:187:23)
npm error gyp ERR! System Darwin 23.2.0
npm error gyp ERR! command "/Users/oliviabark/.nvm/versions/node/v20.16.0/bin/node" "/Users/oliviabark/Documents/terminal/bci-app/node_modules/.bin/node-gyp" "rebuild"
npm error gyp ERR! cwd /Users/oliviabark/Documents/terminal/bci-app/node_modules/msgpack
npm error gyp ERR! node -v v20.16.0
npm error gyp ERR! node-gyp -v v7.1.2
npm error gyp ERR! Node-gyp failed to build your package.
npm error gyp ERR! Try to update npm and/or node-gyp and if it does not help file an issue with the package author.
npm error A complete log of this run can be found in: /Users/oliviabark/.npm/_logs/2024-08-27T20_44_32_205Z-debug-0.log
kevincar commented 1 week ago

As a recap of what we've learned through these errors:

These two lines:

npm error gyp ERR! command "/Users/oliviabark/.nvm/versions/node/v20.16.0/bin/node" "/Users/oliviabark/Documents/terminal/bci-app/node_modules/.bin/node-gyp" "rebuild"
npm error gyp ERR! cwd /Users/oliviabark/Documents/terminal/bci-app/node_modules/msgpack

Indicate that gyp is trying to build some package called msgpack.

It could be that this is misconfigured. One quick way to check this is to clean your working directory and check again. When programs build things, there are artifacts from old attempts that may mess up new attempts. Here are some commands you can run to clean it up

ns clean - this uses the NativeScript command to clean up stuff

rm -rf ./node_modules && nom install - this removes the node_modules folder and attempts to reinstall all required node packages.