Coder Social home page Coder Social logo

Comments (4)

Synesso avatar Synesso commented on August 19, 2024

Using this dockerfile I get a different failure, but a failure nontheless.

FROM ubuntu:artful

USER root

RUN apt update -y
RUN apt install -y \
  curl \
  git

ENV NVM_DIR /root/.nvm

WORKDIR /tmp
RUN git clone https://github.com/mapbox/mapbox-tile-copy.git && \
   cd mapbox-tile-copy && \
   git checkout v6.6.0 && \
   curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash && \
   . $NVM_DIR/nvm.sh && \
   nvm install 5.10.1 && \
   nvm use 5.10.1 && \
   npm install -g @mapbox/mapbox-tile-copy
npm WARN deprecated [email protected]: Package abandoned, contact [email protected] for more info.
npm WARN deprecated [email protected]: renamed to d3-queue
npm WARN deprecated [email protected]: protozero should no longer be used via npm, install instead via https://github.com/mapbox/mason
npm WARN deprecated [email protected]: Use uuid module instead
npm WARN deprecated [email protected]: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130
npm WARN deprecated [email protected]: This module is now under the @mapbox namespace: install @mapbox/tiletype instead
npm WARN deprecated [email protected]: This module has moved: please install @mapbox/vector-tile instead
npm WARN deprecated [email protected]: This module has moved: please install @mapbox/point-geometry instead
/root/.nvm/versions/node/v5.10.1/bin/mapbox-tile-copy -> /root/.nvm/versions/node/v5.10.1/lib/node_modules/@mapbox/mapbox-tile-copy/bin/mapbox-tile-copy.js

> [email protected] install /root/.nvm/versions/node/v5.10.1/lib/node_modules/@mapbox/mapbox-tile-copy/node_modules/gdal
> node-pre-gyp install --fallback-to-build

sh: 1: node-pre-gyp: Permission denied
/root/.nvm/versions/node/v5.10.1/lib
 -- (empty)

from mapbox-tile-copy.

Synesso avatar Synesso commented on August 19, 2024

It's the global install that fails. Local install (like .travis.yml) works.

... but when I attempt to use it:

module.js:471
    throw err;
    ^

Error: Cannot find module '@mapbox/mapbox-file-sniff'
    at Function.Module._resolveFilename (module.js:469:15)

from mapbox-tile-copy.

Synesso avatar Synesso commented on August 19, 2024

This config fixed the issue in the docker image

npm config set user 0
npm config set unsafe-perm true

In full:

FROM ubuntu:artful

USER root

RUN apt update -y
RUN apt install -y \
  curl \
  git

ENV NVM_DIR /root/.nvm

WORKDIR /tmp
RUN git clone https://github.com/mapbox/mapbox-tile-copy.git && \
   cd mapbox-tile-copy && \
   curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash && \
   . $NVM_DIR/nvm.sh && \
   nvm install 6

RUN . $NVM_DIR/nvm.sh && \
   nvm use 6 && \
   npm config set user 0 && \
   npm config set unsafe-perm true && \
   npm install -g @mapbox/mapbox-tile-copy

from mapbox-tile-copy.

springmeyer avatar springmeyer commented on August 19, 2024

npm config set unsafe-perm true is a 👍 workaround. Or, not running as root (which is an npm issue). Closing this is issue has nothing specific to do with mapbox-tile-copy and rather will present itself with any npm install of a module that has dependencies with need to call out to a program to install themselves, like C++ addons using node-pre-gyp.

from mapbox-tile-copy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.