Skip to content

Docker NPM Install Error: require.@selectize/selectize is invalid #1826

Closed
@dan-burt

Description

@dan-burt

I did:

  • [ x] Search for if my issue has already been submitted
  • [x ] Make sure I'm reporting something precise that needs to be fixed
  • [x ] Give my issue a descriptive and concise title
  • [x ] Create a minimal working example on JsFiddle or Codepen
    (or gave a link to a demo on the Selectize docs)
  • [ x] Indicate precise steps to reproduce in numbers and the result,
    like below

Adding Selectize.js to an existing Docker container config, to add this feature to a data entry form. Errors with the Composer container.

Steps to reproduce:

  1. The docker-compose.yml config is:2.
version: '2'

services:
  webapp:
    image: redswitch/php-mongodb:8.0-1.13.0
    container_name: webapp
    volumes:
      - ./html:/var/www/html
      - ./php/mongodb.php.ini:/usr/local/etc/php/conf.d/mongodb.php.ini
    restart: always
    environment:
      - VIRTUAL_HOST=app.domain.com
      - LETSENCRYPT_HOST=app.domain.com
      - LETSENCRYPT_EMAIL=webmaster@domain.com
      - "TZ=Europe/London"
    ports:
      - 80
    expose:
      - 80
    restart: unless-stopped
    
  composer:
    image: composer:2.3
    command: ["composer", "install"]
    volumes:
      - ./html:/app

networks:
  default:
    external:
      name: nginx-proxy-net

  1. The composer.json config (and ensured there is no composer.lock file either, to force redeploying the NPM installs):3.
{
    "require": {
        "mongodb/mongodb": "^1.8.0",
        "vlucas/phpdotenv": "^5.3.0",
        "auth0/auth0-php": "^7.9.0",
        "@selectize/selectize": "^0.13.5"
    },
    "provide" : {
    	"ext-mongodb": "*"
	}
}

  1. docker-compose up -d to start the comtainers. The composer container only runs to deploy the packages then ends. The webapp container remains and should run my web app. This is sat behind an NGinx proxy for SSL certs and routing.

Expected result: Running web app with the Selectize.js component available for use.

Actual result: The following error appears in the composer container's log:

,
In RootPackageLoader.php line 162:,
,
require.@selectize/selectize is invalid, it should have a vendor name, a fo ,
rward slash, and a package name. The vendor and package name can be words s ,
eparated by -, . or . The complete name should match "^[a-z0-9]([.-]?[a-z ,
0-9]+)/a-z0-9$". ,
,
,
install [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--dev] [--no-suggest] [--no-dev] [--no-autoloader] [--no-progress] [--no-install] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--] [...],
,

If I try to use the cdnjs scripts instead, I get a permission error, but would prefer to use NPM, as I have other modules that install via this method without issue.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions