简体   繁体   中英

npm install seems to be not correct

I try to install the npm in an Alpine linux container and I get the stack,

$ npm install 

npm WARN prefer global node-gyp@3.6.2 should be installed with -g

> phantomjs-prebuilt@2.1.14 install /data/craft/templates/node_modules/phantomjs-prebuilt
> node install.js

PhantomJS not found on PATH
Download already available at /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2
Verified checksum of previously downloaded file
Extracting tar contents (via spawned process)
Removing /data/craft/templates/node_modules/phantomjs-prebuilt/lib/phantom
Copying extracted folder /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1553504673093/phantomjs-2.1.1-linux-x86_64 -> /data/craft/templates/node_modules/phantomjs-prebuilt/lib/phantom
Writing location.js file
Done. Phantomjs binary available at /data/craft/templates/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs

> node-sass@4.5.3 install /data/craft/templates/node_modules/node-sass
> node scripts/install.js

Cached binary found at /root/.npm/node-sass/4.5.3/linux_musl-x64-48_binding.node

> uglifyjs-webpack-plugin@0.4.6 postinstall /data/craft/templates/node_modules/uglifyjs-webpack-plugin
> node lib/post_install.js


> gifsicle@3.0.4 postinstall /data/craft/templates/node_modules/gifsicle
> node lib/install.js

  ⚠ spawn /data/craft/templates/node_modules/gifsicle/vendor/gifsicle ENOENT
  ⚠ gifsicle pre-build test failed
  ℹ compiling from source
  ✖ Error: autoreconf -ivf && ./configure --disable-gifview --disable-gifdiff --prefix="/data/craft/templates/node_modules/gifsicle/vendor" --bindir="/data/craft/templates/node_modules/gifsicle/vendor" && make install
Command failed: autoreconf -ivf
/bin/sh: autoreconf: not found

    at ChildProcess.exithandler (child_process.js:204:12)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:886:16)
    at Socket.<anonymous> (internal/child_process.js:342:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:497:12)

> jpegtran-bin@3.2.0 postinstall /data/craft/templates/node_modules/jpegtran-bin
> node lib/install.js

  ⚠ spawn /data/craft/templates/node_modules/jpegtran-bin/vendor/jpegtran ENOENT
  ⚠ jpegtran pre-build test failed
  ℹ compiling from source
  ✖ Error: touch configure.ac aclocal.m4 configure Makefile.am Makefile.in && ./configure --disable-shared --prefix="/data/craft/templates/node_modules/jpegtran-bin/vendor" --bindir="/data/craft/templates/node_modules/jpegtran-bin/vendor" && make install
Command failed: ./configure --disable-shared --prefix="/data/craft/templates/node_modules/jpegtran-bin/vendor" --bindir="/data/craft/templates/node_modules/jpegtran-bin/vendor"
configure: error: newly created file is older than distributed files!
Check your system clock

    at ChildProcess.exithandler (child_process.js:204:12)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:886:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)

> optipng-bin@3.1.4 postinstall /data/craft/templates/node_modules/optipng-bin
> node lib/install.js

  ⚠ spawn /data/craft/templates/node_modules/optipng-bin/vendor/optipng ENOENT
  ⚠ optipng pre-build test failed
  ℹ compiling from source
  ✖ Error: ./configure --with-system-zlib --prefix="/data/craft/templates/node_modules/optipng-bin/vendor" --bindir="/data/craft/templates/node_modules/optipng-bin/vendor" && make install
Command failed: ./configure --with-system-zlib --prefix="/data/craft/templates/node_modules/optipng-bin/vendor" --bindir="/data/craft/templates/node_modules/optipng-bin/vendor"

    at ChildProcess.exithandler (child_process.js:204:12)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:886:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)

> pngquant-bin@3.1.1 postinstall /data/craft/templates/node_modules/pngquant-bin
> node lib/install.js

  ⚠ spawn /data/craft/templates/node_modules/pngquant-bin/vendor/pngquant ENOENT
  ⚠ pngquant pre-build test failed
  ℹ compiling from source
  ✖ Error: pngquant failed to build, make sure that libpng-dev is installed
    at ChildProcess.exithandler (child_process.js:204:12)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:886:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)

> node-sass@4.5.3 postinstall /data/craft/templates/node_modules/node-sass
> node scripts/build.js

Binary found at /data/craft/templates/node_modules/node-sass/vendor/linux_musl-x64-48/binding.node
Testing binary
Binary is fine
welance-craft-base-template@0.2.0 /data/craft/templates
├── @welance/welance-bs@0.8.0 
├── abbrev@1.1.0 
├─┬ accepts@1.3.4 
│ ├── mime-db@1.30.0 

...............................
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.2 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

As I get quite a few errors (with command failed), I wonder if the npm install is correct or I need to do anything additional?

You need to do

sudo apt-get install autoconf

Before you run npm install as that seems to be an error in autoconf in linux.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM