Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get NPM to install modules because of missing obsolete Python2 #5928

Closed
1 task done
JAyenGreen opened this issue Mar 4, 2024 · 5 comments
Closed
1 task done

Comments

@JAyenGreen
Copy link

JAyenGreen commented Mar 4, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Output of ddev debug test

Expand `ddev debug test` diagnostic information
% ddev debug test
Running bash [-c /var/folders/7z/krwqzc0542s8szx09_0s1ktr0000gn/T/test_ddev.sh] 
======= Existing project config =========
These config files were loaded for project ou-law: [/Users/jeffgreenberg/Sites/ou-law/.ddev/config.yaml]
name: ou-law
type: drupal9
docroot: web
php_version: 8.1
webserver_type: nginx-fpm
webimage: ddev/ddev-webserver:v1.22.7
router_http_port: 80
router_https_port: 443
additional_hostnames: []
additional_fqdns: []
database: {mysql 5.7}
project_tld: ddev.site
use_dns_when_possible: true
composer_version: 2
nodejs_version: 16
default_container_timeout: 120
======= Creating dummy project named  tryddevproject-773 in ../tryddevproject-773 =========
OS Information: Darwin Jeffs-MacBook-Pro.local 23.1.0 Darwin Kernel Version 23.1.0: Mon Oct  9 21:27:24 PDT 2023; root:xnu-10002.41.9~6/RELEASE_ARM64_T6000 arm64
ProductName:		macOS
ProductVersion:		14.1.1
BuildVersion:		23B81
User information: uid=501(jeffgreenberg) gid=20(staff) groups=20(staff),12(everyone),61(localaccounts),79(_appserverusr),80(admin),81(_appserveradm),98(_lpadmin),701(com.apple.sharepoint.group.1),33(_appstore),100(_lpoperator),204(_developer),250(_analyticsusers),395(com.apple.access_ftp),398(com.apple.access_screensharing),399(com.apple.access_ssh),400(com.apple.access_remote_ae)
DDEV version:  ITEM             VALUE                                   
 DDEV version     v1.22.7                                 
 architecture     arm64                                   
 db               ddev/ddev-dbserver-mariadb-10.4:v1.22.7 
 ddev-ssh-agent   ddev/ddev-ssh-agent:v1.22.7             
 docker           20.10.22                                
 docker-compose   v2.24.5                                 
 docker-platform  docker-desktop                          
 mutagen          0.17.2                                  
 os               darwin                                  
 router           ddev/ddev-traefik-router:v1.22.7        
 web              ddev/ddev-webserver:v1.22.7             
PROXY settings: HTTP_PROXY='' HTTPS_PROXY='' http_proxy='' NO_PROXY=''
======= DDEV global info =========
Global configuration:
instrumentation-opt-in=true
omit-containers=[]
performance-mode=mutagen
router-bind-all-interfaces=false
internet-detection-timeout-ms=3000
disable-http2=false
use-letsencrypt=false
letsencrypt-email=
table-style=default
simple-formatting=false
use-hardened-images=false
fail-on-hook-fail=false
required-docker-compose-version=v2.24.5
use-docker-compose-from-path=false
project-tld=ddev.site
xdebug-ide-location=
no-bind-mounts=false
router=traefik
wsl2-no-windows-hosts-mgt=false
router-http-port=80
router-https-port=443
mailpit-http-port=8025
mailpit-https-port=8026
traefik-monitor-port=10999

======= DOCKER info =========
docker location: lrwxr-xr-x  1 root  staff  54 Jan  3  2023 /usr/local/bin/docker -> /Applications/Docker.app/Contents/Resources/bin/docker
Docker Desktop Version: Docker Desktop for Mac 4.16.2 build 95914
docker version: 
Client:
 Cloud integration: v1.0.29
 Version:           20.10.22
 API version:       1.41
 Go version:        go1.18.9
 Git commit:        3a2c30b
 Built:             Thu Dec 15 22:28:41 2022
 OS/Arch:           darwin/arm64
 Context:           default
 Experimental:      true

Server: Docker Desktop 4.16.2 (95914)
 Engine:
  Version:          20.10.22
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.18.9
  Git commit:       42c8b31
  Built:            Thu Dec 15 22:25:43 2022
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          1.6.14
  GitCommit:        9ba4b250366a5ddde94bb7c9d1def331423aa323
 runc:
  Version:          1.1.4
  GitCommit:        v1.1.4-0-g5fd4c4d
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
DOCKER_DEFAULT_PLATFORM=notset
======= Mutagen Info =========
Mutagen is installed in ddev, version=0.17.2
--------------------------------------------------------------------------------
Name: ou-law
Identifier: sync_Yay5UB56FFBlY1PmmYWBiTbyldzgoKXlP0tg22m6M2A
Labels:
	com.ddev.config-hash: c212281329fb24762a96e1b7a37a19ed84868866
	com.ddev.volume-signature: var-run-1709570435
Configuration:
	Synchronization mode: Two Way Resolved
	Hashing algorithm: Default (SHA-1)
	Maximum allowed entry count: Default (2⁶⁴−1)
	Maximum staging file size: Default (18 EB)
	Symbolic link mode: POSIX Raw
	Ignore VCS mode: Default (Propagate)
	Ignores:
		/.git
		/.tarballs
		/.ddev/db_snapshots
		/.ddev/.importdb*
		.DS_Store
		.idea
		/web/sites/default/files
	Permissions mode: Default (Portable)
Alpha:
	URL: /Users/jeffgreenberg/Sites/ou-law
	Configuration:
		Watch mode: Default (Portable)
		Watch polling interval: Default (10 seconds)
		Probe mode: Default (Probe)
		Scan mode: Default (Accelerated)
		Stage mode: Neighboring
		File mode: Default (0600)
		Directory mode: Default (0700)
		Default file/directory owner: Default
		Default file/directory group: Default
	Connected: Yes
	Synchronizable contents:
		13191 directories
		65109 files (432 MB)
		61 symbolic links
Beta:
	URL: docker://ddev-ou-law-web/var/www/html
		DOCKER_HOST=unix:///var/run/docker.sock
	Configuration:
		Watch mode: Default (Portable)
		Watch polling interval: Default (10 seconds)
		Probe mode: Default (Probe)
		Scan mode: Default (Accelerated)
		Stage mode: Neighboring
		File mode: Default (0600)
		Directory mode: Default (0700)
		Default file/directory owner: Default
		Default file/directory group: Default
		Compression: Default (DEFLATE)
	Connected: Yes
	Synchronizable contents:
		13191 directories
		65109 files (432 MB)
		61 symbolic links
Status: Watching for changes
--------------------------------------------------------------------------------
======= Docker Info =========
Docker platform: docker-desktop 
Using Docker context: default (unix:///var/run/docker.sock) 
docker-compose: v2.24.5 
Using DOCKER_HOST=unix:///var/run/docker.sock 
Docker version: 20.10.22 
Able to run simple container that mounts a volume. 
Able to use internet inside container. 
Docker disk space:
Filesystem                Size      Used Available Use% Mounted on
overlay                  95.0G     58.5G     31.6G  65% /

Unable to create project at project root '/Users/jeffgreenberg/Sites/test-drupal9-site': project root /Users/jeffgreenberg/Sites/test-drupal9-site does not exist
Unable to create project at project root '/Users/jeffgreenberg/Sites/sandbox': project root /Users/jeffgreenberg/Sites/sandbox does not exist
Unable to create project at project root '/Users/jeffgreenberg/Sites/lilp-d7': project root /Users/jeffgreenberg/Sites/lilp-d7 does not exist
Unable to create project at project root '/Users/jeffgreenberg/Sites/sandbox-d10': project root /Users/jeffgreenberg/Sites/sandbox-d10 does not exist
Unable to create project at project root '/Users/jeffgreenberg/Sites/test-drupal10-site': project root /Users/jeffgreenberg/Sites/test-drupal10-site does not exist
 Container ddev-ou-law-db  Stopped
 Container ddev-ou-law-web  Stopped
 Container ddev-ou-law-db  Stopped
 Container ddev-ou-law-web  Stopped
 Container ddev-ou-law-db  Removed
 Container ddev-ou-law-web  Removed
 Network ddev-ou-law_default  Removed
Project ou-law has been stopped.
Stopped Mutagen daemon
The ddev-ssh-agent container has been removed. When you start it again you will have to use 'ddev auth ssh' to provide key authentication again.
Network ddev_default removed
Existing docker containers: 
CONTAINER ID   IMAGE                                COMMAND                  CREATED        STATUS                      PORTS                                                                       NAMES
760aec5aadd6   9dfd9208fd86                         "/bin/sh"                2 months ago   Created                                                                                                 phpstorm_helpers_PS-232.10227.13
f9c8ba39692e   ddev-lilpd7-solr                     "docker-entrypoint.s…"   3 months ago   Exited (255) 6 weeks ago    0.0.0.0:8983->8983/tcp                                                      ddev-lilpd7-solr-1
9b5121dd23a9   bitnami/mysql:5.7.29-debian-10-r51   "/lando-entrypoint.s…"   8 months ago   Exited (255) 8 months ago   127.0.0.1:3308->3306/tcp                                                    bmcd9_d7_database_1
7a7d378cf304   phpmyadmin/phpmyadmin:5.1.1          "/lando-entrypoint.s…"   8 months ago   Exited (255) 8 months ago   127.0.0.1:32821->80/tcp                                                     bmcd9_phpmyadmin_1
bb7fa56fd1a9   bitnami/mysql:5.7.29-debian-10-r51   "/lando-entrypoint.s…"   8 months ago   Exited (255) 8 months ago   127.0.0.1:3307->3306/tcp                                                    bmcd9_database_1
35ba47d636d8   mailhog/mailhog:v1.0.1               "/lando-entrypoint.s…"   8 months ago   Exited (255) 8 months ago   1025/tcp, 8025/tcp, 127.0.0.1:32818->80/tcp                                 bmcd9_mailhog_1
46c222da5edf   devwithlando/php:8.1-apache-4        "/lando-entrypoint.s…"   8 months ago   Exited (255) 8 months ago   127.0.0.1:32820->80/tcp, 127.0.0.1:32819->443/tcp                           bmcd9_appserver_1
091c874622ba   traefik:2.2.0                        "/lando-entrypoint.s…"   8 months ago   Exited (255) 8 months ago   127.0.0.1:8000->80/tcp, 127.0.0.1:444->443/tcp, 127.0.0.1:32811->8080/tcp   landoproxyhyperion5000gandalfedition_proxy_1
Network ddev_default created 

 TIP OF THE DAY                                                                  
 `ddev poweroff` is a great way to get back to the beginning and save resources. 
 
Starting tryddevproject-773... 
Network ddev-tryddevproject-773_default created 
 Container ddev-ssh-agent  Created 
 Container ddev-ssh-agent  Started 
ssh-agent container is running: If you want to add authentication to the ssh-agent container, run 'ddev auth ssh' to enable your keys. 
v1.22.7: Pulling from ddev/ddev-dbserver-mariadb-10.4
bc5b5b7ccd1e: Pull complete 
9e0cf7962aa4: Pull complete 
06186067ba21: Pull complete 
78439c680642: Pull complete 
ffdd7468429b: Pull complete 
df7cbf30cd0c: Pull complete 
9535641f7a05: Pull complete 
7d8afb04fc5a: Pull complete 
4d38d384655e: Pull complete 
4f4fb700ef54: Pull complete 
1f0973353446: Pull complete 
797f8674b59d: Pull complete 
f702f6c2a6af: Pull complete 
6f1942c99ffc: Pull complete 
6793c5599f10: Pull complete 
633fa2cfa563: Pull complete 
0464cb2bae25: Pull complete 
5cc696f4d5c5: Pull complete 
e088fdf082dc: Pull complete 
ae72d21a0582: Pull complete 
7b75c5875ea0: Pull complete 
cf1a50f28cfc: Pull complete 
ac1f4c43c4a5: Pull complete 
607e68c5764e: Pull complete 
714606422904: Pull complete 
Digest: sha256:e3b3e4f0325bd7030c97058cef743bc971fbeb65b55bf3b277d8353e3801e067
Status: Downloaded newer image for ddev/ddev-dbserver-mariadb-10.4:v1.22.7
docker.io/ddev/ddev-dbserver-mariadb-10.4:v1.22.7
Building project images... 
...Project images built in 5s. 
 Container ddev-tryddevproject-773-db  Created 
 Container ddev-tryddevproject-773-web  Created 
 Container ddev-tryddevproject-773-db  Started 
 Container ddev-tryddevproject-773-web  Started 
You have Mutagen enabled and your 'php' project type doesn't have `upload_dirs` set. 
For faster startup and less disk usage, set upload_dirs to where your user-generated files are stored. 
If this is intended you can disable this warning with `ddev config --disable-upload-dirs-warning`. 
Starting Mutagen sync process... 
Mutagen sync flush completed in 10s.
For details on sync status 'ddev mutagen st tryddevproject-773 -l' 
Waiting for web/db containers to become ready: [web db] 
Starting ddev-router if necessary... 
 Container ddev-router  Created 
 Container ddev-router  Started 
Waiting for additional project containers to become ready... 
All project containers are now ready. 
Successfully started tryddevproject-773 
Project can be reached at https://tryddevproject-773.ddev.site https://127.0.0.1:56123 
======== Curl of site from inside container:
HTTP/1.1 200 OK
Server: nginx
Date: Mon, 04 Mar 2024 17:05:11 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Vary: Accept-Encoding

======== curl -I of http://tryddevproject-773.ddev.site from outside:
HTTP/1.1 200 OK
Content-Type: text/html; charset=UTF-8
Date: Mon, 04 Mar 2024 17:05:12 GMT
Server: nginx
Vary: Accept-Encoding

======== full curl of http://tryddevproject-773.ddev.site from outside:
Success accessing database... db via TCP/IP
ddev is working. You will want to delete this project with 'ddev delete -Oy tryddevproject-773'
======== Project ownership on host:
drwxr-xr-x  4 jeffgreenberg  staff  128 Mar  4 12:03 ../tryddevproject-773
======== Project ownership in container:
drwxr-xr-x 4 jeffgreenberg dialout 4096 Mar  4 17:04 /var/www/html
======== In-container filesystem:
Filesystem     Type 1K-blocks     Used Available Use% Mounted on
/dev/vda1      ext4  99643820 62882060  31667312  67% /var/www
======== curl again of tryddevproject-773 from host:
Success accessing database... db via TCP/IP
ddev is working. You will want to delete this project with 'ddev delete -Oy tryddevproject-773'
Thanks for running the diagnostic. It was successful.
Please provide the output of this script in a new gist at gist.github.com
Running ddev launch in 5 seconds

Please run cleanup after debugging with 'ddev debug testcleanup'

Expected Behavior

I expect
ddev npm install
to do a clean install.

Actual Behavior

gyp verb check python checking for Python executable "python2" in the PATH gyp verb whichfailed Error: not found: python2 ... gyp verb check python checking for Python executable "python" in the PATH gyp verbwhichsucceeded python /usr/bin/python

Steps To Reproduce

No response

Anything else?

Tried with versions 18.13.0 (which our FE devs use) and 14.8.0 (which our BE devs use) of node.
From inside project, python2, python3 and python commands all run python, 2.7.18, 3.10.12 and 3.10.12, respectively.

@JAyenGreen JAyenGreen changed the title Can't get NPM to run cleanly because of Python2 Can't get NPM to install modules cleanly because of Python2 Mar 4, 2024
@rfay
Copy link
Member

rfay commented Mar 4, 2024

Hi @JAyenGreen - Python2 has long been obsolete and removed from Debian and Ubuntu. You'll want to figure out how to use npm packages that don't require it.

If you actually need it, you can use

webimage_extra_packages: [python2]

If you want the python command to be python2, you can also do

webimage_extra_packages: [python-is-python2]

in DDEV v1.22.7.

However, that won't be possible in upcoming v1.23.0, which is based on Debian 12 Bookworm, where they have dropped even this. The internet does have lots of suggestions for you but it's not something you're going to like.

@JAyenGreen
Copy link
Author

Thanks, @rfay. Ugh. Of course...it's Monday.

@rfay
Copy link
Member

rfay commented Mar 4, 2024

Sounds like you're on the path now, closing, happy to continue the conversation here or elsewhere.

@rfay rfay closed this as completed Mar 4, 2024
@rfay rfay changed the title Can't get NPM to install modules cleanly because of Python2 Can't get NPM to install modules because of missing obsolete Python2 Mar 4, 2024
@rfay
Copy link
Member

rfay commented Mar 4, 2024

BTW, not sure what npm ddev install is. You may have meant ddev npm install I hope.

@JAyenGreen
Copy link
Author

Yup, as you typed it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants