Open antoinecomp opened 6 years ago
I have now downloaded npm last version. I ran npm run build
but I got two errors with confusion@1.0.0 imagemin script.
and confusion@1.0.0 build script
:
mike@mike-thinks:~/Bootstrap4/conFusion$ npm run build
> confusion@1.0.0 build /home/mike/Bootstrap4/conFusion
> npm run clean && npm run imagemin && npm run copyfonts && npm run usemin
> confusion@1.0.0 clean /home/mike/Bootstrap4/conFusion
> rimraf dist
> confusion@1.0.0 imagemin /home/mike/Bootstrap4/conFusion
> imagemin img/* -o dist/img
Error: Error in file: img/logo.png
spawn /usr/local/lib/node_modules/imagemin-cli/node_modules/optipng-bin/vendor/optipng ENOENT
at _errnoException (util.js:1031:13)
at Process.ChildProcess._handle.onexit (internal/child_process.js:201:19)
at onErrorNT (internal/child_process.js:389:16)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! confusion@1.0.0 imagemin: `imagemin img/* -o dist/img`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the confusion@1.0.0 imagemin script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/mike/.npm/_logs/2017-12-27T11_42_38_033Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! confusion@1.0.0 build: `npm run clean && npm run imagemin && npm run copyfonts && npm run usemin`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the confusion@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/mike/.npm/_logs/2017-12-27T11_42_38_103Z-debug.log
Here is the log for imagemin:
imagemin img/* -o dist/img,
2017-12-27T11_42_38_033Z-debug.log` :
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'imagemin' ]
2 info using npm@5.5.1
3 info using node@v9.2.1
4 verbose run-script [ 'preimagemin', 'imagemin', 'postimagemin' ]
5 info lifecycle confusion@1.0.0~preimagemin: confusion@1.0.0
6 info lifecycle confusion@1.0.0~imagemin: confusion@1.0.0
7 verbose lifecycle confusion@1.0.0~imagemin: unsafe-perm in lifecycle true
8 verbose lifecycle confusion@1.0.0~imagemin: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/home/mike/Bootstrap4/conFusion/node_modules/.bin:/usr/local/lib/node_modules/npm/bin/node-gyp-bin:/home/mike/Bootstrap4/conFusion/node_modules/.bin:/home/mike/bin:/home/mike/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin:/usr/lib/jvm/java-version/bin:/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java/bin:/usr/local/hadoop/bin
9 verbose lifecycle confusion@1.0.0~imagemin: CWD: /home/mike/Bootstrap4/conFusion
10 silly lifecycle confusion@1.0.0~imagemin: Args: [ '-c', 'imagemin img/* -o dist/img' ]
11 silly lifecycle confusion@1.0.0~imagemin: Returned: code: 1 signal: null
12 info lifecycle confusion@1.0.0~imagemin: Failed to exec imagemin script
13 verbose stack Error: confusion@1.0.0 imagemin: `imagemin img/* -o dist/img`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:280:16)
13 verbose stack at EventEmitter.emit (events.js:159:13)
13 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:159:13)
13 verbose stack at maybeClose (internal/child_process.js:943:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
14 verbose pkgid confusion@1.0.0
15 verbose cwd /home/mike/Bootstrap4/conFusion
16 verbose Linux 4.10.0-42-generic
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "imagemin"
18 verbose node v9.2.1
19 verbose npm v5.5.1
20 error code ELIFECYCLE
21 error errno 1
22 error confusion@1.0.0 imagemin: `imagemin img/* -o dist/img`
22 error Exit status 1
23 error Failed at the confusion@1.0.0 imagemin script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
And here is the one for confusion@1.0.0 build script
, 2017-12-27T11_42_38_103Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'build' ]
2 info using npm@5.5.1
3 info using node@v9.2.1
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle confusion@1.0.0~prebuild: confusion@1.0.0
6 info lifecycle confusion@1.0.0~build: confusion@1.0.0
7 verbose lifecycle confusion@1.0.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle confusion@1.0.0~build: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/home/mike/Bootstrap4/conFusion/node_modules/.bin:/home/mike/bin:/home/mike/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin:/usr/lib/jvm/java-version/bin:/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java/bin:/usr/local/hadoop/bin
9 verbose lifecycle confusion@1.0.0~build: CWD: /home/mike/Bootstrap4/conFusion
10 silly lifecycle confusion@1.0.0~build: Args: [ '-c',
10 silly lifecycle 'npm run clean && npm run imagemin && npm run copyfonts && npm run usemin' ]
11 silly lifecycle confusion@1.0.0~build: Returned: code: 1 signal: null
12 info lifecycle confusion@1.0.0~build: Failed to exec build script
13 verbose stack Error: confusion@1.0.0 build: `npm run clean && npm run imagemin && npm run copyfonts && npm run usemin`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:280:16)
13 verbose stack at EventEmitter.emit (events.js:159:13)
13 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:159:13)
13 verbose stack at maybeClose (internal/child_process.js:943:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
14 verbose pkgid confusion@1.0.0
15 verbose cwd /home/mike/Bootstrap4/conFusion
16 verbose Linux 4.10.0-42-generic
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build"
18 verbose node v9.2.1
19 verbose npm v5.5.1
20 error code ELIFECYCLE
21 error errno 1
22 error confusion@1.0.0 build: `npm run clean && npm run imagemin && npm run copyfonts && npm run usemin`
22 error Exit status 1
23 error Failed at the confusion@1.0.0 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
use this in scripts
"imagemin": "imagemin img/* --out-dir dist/img"
also use npm install --save-dev imagemin imagemin-cli
@hTrap this doesn't solve the problem. Env: Win 10 cygwin.
@hTrap Thanks... that solved the problem
I am learning how to create a distribution folder that contains the files that can be implemented on a web server hosting your project. This distribution folder will be compiled from the files of your project using various NPM packages and scripts.
However when I try to execute the command
npm run build
and I have errors withimagemin img/* -o dist/img
The code is on Bitbucket
The file npm-debug.log is :
I would be very glad for any help. I am new to minifying