tilemill icon indicating copy to clipboard operation
tilemill copied to clipboard

Mac M1 install error

Open pankus opened this issue 1 year ago • 3 comments

related to #2759

If I follow this instruction from Tilemill documentation:

git clone https://github.com/tilemill-project/tilemill.git
cd tilemill
nvm install lts/carbon
nvm use v8.15.0
npm install

with the following result (from log):

5692 verbose node v8.15.0
5693 verbose npm  v6.4.1
5694 error Error while executing:
5694 error /usr/bin/git ls-remote -h -t git://github.com/florianf/bones.git
5694 error
5694 error undefined
5694 error exited with error code: 128
5695 verbose exit [ 1, true ]

end from terminal:

amigo@MBP tilemill % npm install
npm WARN [email protected] No license field.

npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t git://github.com/florianf/bones.git
npm ERR!
npm ERR! undefined
npm ERR! exited with error code: 128

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/amigo/.npm/_logs/2022-09-03T03_46_08_346Z-debug.log

I presume that there is a remote connection problem, thus I tried to launch the simple command: /usr/bin/git ls-remote -h -t git://github.com/florianf/bones.git This is the response: fatal: unable to connect to github.com: github.com[0: 140.82.121.3]: errno=Operation timed out

pankus avatar Sep 03 '22 22:09 pankus

I guess that the problem could be related to the way github is being accessed. If I replace git:// with https:// in the command git ls-remote -h -t https://github.com/florianf/bones.git a valid response is returned. How can I force npm to access github with the https protocol?

update In order to force an https connection, it is necessary to give the following command: git config --global url."https://".insteadOf git:// After that, the installation procedure works well (this page)

possibly related to #2737

pankus avatar Sep 03 '22 22:09 pankus

@pankus Thanks for doing more troubleshooting on this. I have recently acquired an M1 for work, so decided to go through the installation process. I found the following issues and fixes, and was able to complete the installation.

Tips & Hints for Installing on OSX M1:

  1. Need to run iTerm (Terminal or iTerm2) in Rosetta mode. Instructions
  2. If you get an error about npm not being compatible with v8.17.0
  • Uninstall node: nvm uninstall v8.17.0
  • Reinstall node: nvm install v8.17.0
  • Don't re-run script, which will execute nvm install-latest-npm, which will screw things up.
  1. Manually run the git commands from the script to checkout branch, if they didn't run earlier.
  2. Either run pankus' command above to change git default to https, or edit the package-lock.json file that was installed, and replace all git:// occurrences with https://.
  3. Execute npm clean-install

I was able to successfully start up Tilemill and run the sample projects that didn't try to use Postgres (Road Trip won't work). If you want Postgress, then you need to run the ./installdb.sh installation script, but update it to use the arm processor, if running in Rosetta mode. I didn't test running the install in non-Rosetta, since I already changed my iTerm. Possible that if you

  1. Edit the ./tilemill/utils/installdb.sh script:
  • find every brew install ... line, and add arch -arm64 before it. So that each occurrence looks like:
  • arch -arm64 brew install ...

Not sure if the following is due to M1 issues, or just weird/random OSX issues. Got an error that it couldn't run: creating directory /usr/local/var/postgres ... initdb: error: could not create directory "/usr/local/var": Permission denied

My steps to fix:

  1. $ sudo mkdir /usr/local/var
  2. $ sudo chown -R whoami /usr/local/var
  3. $ initdb /usr/local/var/postgres -E utf8 ....run the rest of the commands in the script manually.

Project Road Trip now works.

csytsma avatar Sep 05 '22 04:09 csytsma