Build question about old node module requested by package.json

I'm trying to build locally on a mac bigsur and the package.json of the ide want an old node:
"engines": {
"node": ">=12.14.1 <13"
},

so as expected:

arduino-ide@2.0.0-rc2: The engine "node" is incompatible with this module. Expected version ">=12.14.1 <13". Got "17.2.0"

How do you handle this? Downgrade node? yarn --ignore-engine?
Any hints for me?

@intstarep
on Mac I have resorted to nvm but since I have an M1 I have further dependencies which cannot be met.
What are you building on?

It's a common problem with several solutions, I personally use nvm, someone else in the team uses n. They both pretty well I gotta say.

on a intel.

i downgraded with nvm. thx to the team & all the contributors!

1 Like

yeah, nvm is nice because it won't bother the rest of your system and you can build locally with that version.
With Intel you should be fine with the build.
Good luck :v:

I had to unlink the actual and relink the old node version to solve that one but now gyp struggle with the (new) xcode CLI.

gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  CXX(target) Release/obj.target/drivelist/src/drivelist.o
  CXX(target) Release/obj.target/drivelist/src/device-descriptor.o
  CXX(target) Release/obj.target/drivelist/src/darwin/list.o
In file included from ../src/darwin/list.mm:21:
In file included from ../src/darwin/REDiskList.h:21:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:
/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:91:143: error: function does not return NSString
- (NSAttributedString *)localizedAttributedStringForKey:(NSString *)key value:(nullable NSString *)value table:(nullable NSString *)tableName NS_FORMAT_ARGUMENT(1) NS_REFINED_FOR_SWIFT API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
                                                         ~~~~~~~~~~~~~~                                                                       ^                  ~
/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:103:48: note: expanded from macro 'NS_FORMAT_ARGUMENT'
        #define NS_FORMAT_ARGUMENT(A) __attribute__ ((format_arg(A)))
                                                      ^          ~
1 error generated.
make: *** [Release/obj.target/drivelist/src/darwin/list.o] Error 1

To save time, my simple question is: has anyone done a successful local build on (intel) mac and can provide some hints ?

@intstarep
I'll ask our devs to reply to you.
We do build on Intel Macs

Thank you! Maybe they can put their instructions on the github building.md file for others.

Probably i am the problem but i was not able to build local nor on github just out of the box with the instructions provided on building.md.

The error codes
(NSAttributedString *)localizedAttributedStringForKey:(NSString *)key value:(nullable NSString *)value table:(nullable NSString *)tableName NS_FORMAT_ARGUMENT(1) NS_REFINED_FOR_SWIFT API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
and

[ **build (macos-latest)** ](https://github.com/CptHolzschnauz/arduino-ide/runs/4557310825?check_suite_focus=true)

DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020.

seems to me that some stuff is maybe just a little outdated and with little effort this can be fixed?

Its's a HUGE project, thx to all, without a local build out of the box it's a bit daunting to me to participate.

Happy Holidays anyway!

Of course!
Last time I built it on my machine I was on Big Sur (Intel) and it needed tweaks.
I have asked our devs to refine the build instructions.
Hang in there :slight_smile:

I'm happy to improve the documentation and make it more clear.

If this can help I can copy over the setup instructions from theia to our repo in order to make it user friendly.

Based on your error message, and considering you are using node 12 already, I suspect there is some issue with the Xcode command line tools installed on your machine.

Can you try removing and re-installing them running the following commands on your terminal?

  1. sudo rm -rf /Library/Developer/CommandLineTools
  2. xcode-select --install

Once this is done, let me know if running the yarn command works.

@intstarep I suggest to comment directly on the PR I just opened here Improve build instructions by fstasi · Pull Request #706 · arduino/arduino-ide · GitHub with the full errors you might have.

Thanks again for the contribution!

Thx for your effort.

No, won't help.

As i mentioned before, i unlinked node 17, installed 12 and linked it, that was all.

Because the error adressed the newest apple releases (Monterey et all) could it be the build
instructions mac-os-latest is not compatible anymore?


gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  CXX(target) Release/obj.target/drivelist/src/drivelist.o
  CXX(target) Release/obj.target/drivelist/src/device-descriptor.o
  CXX(target) Release/obj.target/drivelist/src/darwin/list.o
In file included from ../src/darwin/list.mm:21:
In file included from ../src/darwin/REDiskList.h:21:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:
/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:91:143: error: function does not return NSString
- (NSAttributedString *)localizedAttributedStringForKey:(NSString *)key value:(nullable NSString *)value table:(nullable NSString *)tableName NS_FORMAT_ARGUMENT(1) NS_REFINED_FOR_SWIFT API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
                                                         ~~~~~~~~~~~~~~                                                                       ^                  ~
/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:103:48: note: expanded from macro 'NS_FORMAT_ARGUMENT'
        #define NS_FORMAT_ARGUMENT(A) __attribute__ ((format_arg(A)))
                                                      ^          ~
1 error generated.
make: *** [Release/obj.target/drivelist/src/darwin/list.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/probolt/Documents/develop/arduino-ide2/node_modules/electron-rebuild/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Darwin 20.6.0
gyp ERR! command "/usr/local/Cellar/node@12/12.22.7/bin/node" "/Users/probolt/Documents/develop/arduino-ide2/node_modules/.bin/node-gyp" "rebuild"
gyp ERR! cwd /Users/probolt/Documents/develop/arduino-ide2/node_modules/drivelist

I got the solution! You simply have to upgrade to the newsest os 12 (monterey)!

Solution: Install os 12 monterey and update the xcode cli over the regular software update then the build process is successfull out of the box!


yarn run v1.22.17
$ theia download:plugins
--- downloading plugins ---
+ vscode-arduino-tools: downloaded successfully 
+ vscode-builtin-json: downloaded successfully 
+ vscode-builtin-cpp: downloaded successfully 
+ vscode-builtin-json-language-features: downloaded successfully 
+ cortex-debug: downloaded successfully 
--- collecting extension-packs ---
--- collecting extension dependencies ---
✨  Done in 14.21s.
✨  Done in 127.72s.

It's not possible to run mac-os-latest with the xcode cli on 'older' mac os!

So the xcode cli is updated to the latest release even on 'older' os versions (big sur et all) but the build process is only sucessfull with os 12 (montery) installed!

@ubidefeo : Try to build on your m1 machine with os 12 and updated xcode.

@f_stasi : Maybe a little hint on the BUILDING.MV would be helpful for others with 'older' os on mac.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.