thecodingmachine / docker-images-php

A set of PHP Docker images
MIT License
785 stars 138 forks source link

[bug] Broken npm version in 8.0-v4-apache-node10 #294

Closed homersimpsons closed 2 years ago

homersimpsons commented 2 years ago

Expected Behavior

No issue running npm --version

Current Behavior

$ npm --version
npm does not support Node.js v10.24.1
You should probably upgrade to a newer version of node as we
can't make any promises that npm will work with this version.
You can find the latest version at https://nodejs.org/
/usr/lib/node_modules/npm/lib/npm.js:32
  #unloaded = false
  ^

SyntaxError: Invalid or unexpected token
    at Module._compile (internal/modules/cjs/loader.js:723:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at module.exports (/usr/lib/node_modules/npm/lib/cli.js:22:15)
    at Object.<anonymous> (/usr/lib/node_modules/npm/bin/npm-cli.js:2:25)
    at Module._compile (internal/modules/cjs/loader.js:778:30)

Possible Solution

Downgrade npm ?

Steps to Reproduce (for bugs)

  1. docker run --name brave_diffie thecodingmachine/php:8.0-v4-apache-node10
  2. docker exec -ti brave_diffie bash
  3. npm --version (in the container)

Context

I cannot use npm anymore in such containers

Your Environment

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please update it if any action still required.

homersimpsons commented 2 years ago

(No, this still is broken)

sandermarechal commented 2 years ago

Can confirm, this is broken for me too.

sandermarechal commented 2 years ago

Any update on this? I have submitted a PR with the fix.