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

NPM fails with node:latest, works with node:14 #3178

Closed
markddrake opened this issue Jan 18, 2021 · 3 comments
Closed

NPM fails with node:latest, works with node:14 #3178

markddrake opened this issue Jan 18, 2021 · 3 comments

Comments

@markddrake
Copy link

Docker Info

C:\Development\YADAMU\scratch\docker>docker info
Client:
 Debug Mode: false

Server:
 Containers: 15
  Running: 12
  Paused: 0
  Stopped: 3
 Images: 37
 Server Version: 19.03.13
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 8fba4e9a7d01810a393d5d25a3621dc101981175
 runc version: dc9208a3303feef5b3839f4323d9beb36df0a9dd
 init version: fec3683
 Security Options:
  apparmor
  seccomp
   Profile: default
 Kernel Version: 4.15.0-55-generic
 Operating System: Ubuntu 18.04.3 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 62.83GiB
 Name: yadamu-db1
 ID: EGV4:B4VW:63CM:LAZA:HIP6:HGYU:5FZT:OUNT:NHYX:TRQY:MTBP:LYH3
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Environment

Build Script

docker rmi -f yadamu/docker:test
set DOCKER_BUILDKIT=1
docker info
docker build -t  yadamu/docker:test . -fdockerfile --no-cache --progress=plain

Package.json

{
  "name": "yadamu",
  "version": "1.0.0",
  "description": "User Interface for YADAMU",
  "main": "main.js",
  "scripts": {
    "start": "electron ./"
  },
  "repository": {
    "type": "git",
    "url": "TBD"
  },
  "author": "Mark D Drake",
  "license": "SEE LICENSE IN TDB.txt",
  "dependencies": {
    "@azure/storage-blob": "^12.2.0-preview.1",
    "@teradataprebuilt/nativelib-win32": "^1.0.0-beta.1",
    "aws-sdk": "^2.731.0",
    "bootstrap": "^4.4.1",
    "cookie-parser": "^1.4.5",
    "express": "^4.17.1",
    "express-session": "^1.17.1",
    "ffi-napi": "^3.0.1",
    "font-awesome": "^4.7.0",
    "install": "^0.13.0",
    "jquery": "^3.5.0",
    "mariadb": "^2.3.1",
    "mime-types": "^2.1.28",
    "mongodb": "^3.5.7",
    "mssql": "^6.2.3",
    "mysql": "^2.18.1",
    "npm": "^6.14.8",
    "oracledb": "^4.2.0",
    "pg": "^8.0.3",
    "pg-copy-streams": "^2.2.2",
    "pg-query-stream": "^4.0.0",
    "popper.js": "^1.16.1",
    "snowflake-sdk": "^1.5.2",
    "teradata-nodejs-driver": "^1.0.0-rc.2",
    "uuid": "^8.0.0",
    "wkx": "^0.5.0"
  },
  "devDependencies": {
    "electron": "^9.0.0"
  }
}

dockerfile (node:14)

FROM node:14
COPY package*.json ./
RUN node --version \
 && npm --version  \
 && npm install -g 

output (node:14)

nodejs/docker-node#7 [3/3] RUN node --version  && npm --version   && npm install -g
nodejs/docker-node#7 0.462 v14.15.4
nodejs/docker-node#7 0.630 6.14.10
nodejs/docker-node#7 2.105 npm WARN deprecated [email protected]: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
nodejs/docker-node#7 10.20 npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
nodejs/docker-node#7 10.46 npm WARN deprecated [email protected]: this library is no longer supported
nodejs/docker-node#7 18.67 npm WARN lifecycle [email protected]~install: cannot run in wd [email protected] node-gyp-build (wd=/node_modules/ref-napi)
nodejs/docker-node#7 18.67 npm WARN lifecycle [email protected]~install: cannot run in wd [email protected] node-gyp-build (wd=/node_modules/ffi-napi)
nodejs/docker-node#7 18.68 npm WARN lifecycle [email protected]~install: cannot run in wd [email protected] node package/install.js (wd=/node_modules/oracledb)
nodejs/docker-node#7 18.69 npm WARN lifecycle [email protected]~install: cannot run in wd [email protected] node scripts/install-dependencies.js (wd=/node_modules/teradata-nodejs-driver)
nodejs/docker-node#7 18.80 + [email protected]
nodejs/docker-node#7 18.80 added 746 packages from 1201 contributors in 17.794s
nodejs/docker-node#7 DONE 19.1s

Dockerfile (Node:latest)

FROM node:latest
COPY package*.json ./
RUN node --version \
 && npm --version  \
 && npm install -g 

Output (Node:latest)

nodejs/docker-node#7 [3/3] RUN node --version  && npm --version   && npm install -g
nodejs/docker-node#7 0.443 v15.5.1
nodejs/docker-node#7 0.634 7.3.0
nodejs/docker-node#7 1.101 npm notice
nodejs/docker-node#7 1.101 npm notice New minor version of npm available! 7.3.0 -> 7.4.2
nodejs/docker-node#7 1.101 npm notice Changelog: <https://github.com/npm/cli/releases/tag/v7.4.2>
nodejs/docker-node#7 1.101 npm notice Run `npm install -g [email protected]` to update!
nodejs/docker-node#7 1.101 npm notice
nodejs/docker-node#7 1.108 npm ERR! Maximum call stack size exceeded
nodejs/docker-node#7 1.126
nodejs/docker-node#7 1.126 npm ERR! A complete log of this run can be found in:
nodejs/docker-node#7 1.127 npm ERR!     /root/.npm/_logs/2021-01-18T00_13_35_392Z-debug.log
nodejs/docker-node#7 ERROR: executor failed running [/bin/sh -c node --version  && npm --version   && npm install -g]: runc did not terminate sucessfully
------
@nschonni
Copy link
Member

What do you expect npm install -g with no parameters to be doing?

"Works with latest" means Node 15 and NPM 7. Node 14 ships with NPM 6. I don' think this is related to this repository

@nschonni nschonni transferred this issue from nodejs/docker-node Jan 18, 2021
@markddrake
Copy link
Author

markddrake commented Jan 22, 2021

My understanding was that it should install (globally) the NPM modules in the package.json located in the current working directory. It appears to do so in node:14/npm:6.x.x. Sorry if I'm missing something obvious here

BTW I did get this to work using this one

FROM node:latest
WORKDIR /usr/src/YADAMU
ADD https://download.oracle.com/otn_software/linux/instantclient/19600/oracle-instantclient19.6-basic-19.6.0.0.0-1.x86_64.rpm .
COPY src/package*.json ./
RUN apt update \
 && apt-get -y install libaio1 \
 && apt-get -y install alien \
 && alien -i ./oracle-instantclient19.6-basic-19.6.0.0.0-1.x86_64.rpm \
 && npm install --global electron \
 && npm install

@RedYetiDev RedYetiDev added the npm label May 3, 2024
@RedYetiDev
Copy link
Member

AFAIK npm install -g won't use the package.json, as it's running globally, not locally. It's possible in older versions this behavior was different, but as of my knowledge, this is it.

If you have further questions, please ask.

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

No branches or pull requests

3 participants