angular-fullstack / generator-angular-fullstack

Yeoman generator for an Angular app with an Express server
https://awk34.gitbook.io/generator-angular-fullstack
6.12k stars 1.24k forks source link

node-zopfli@1.4.0 install: `node-pre-gyp install --fallback-to-build` #2545

Open vipinlahoti opened 7 years ago

vipinlahoti commented 7 years ago
Item Version
generator-angular-fullstack v4.2.0
Node 6.3.1
npm 3.10.3
Operating System OS X 10 and Windows 10
Item Answer
Transpiler Babel
Markup HTML
css SCSS
Router ui-router
Client Tests Jasmine
DB MongoDB
Auth Y
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v6.3.1
npm ERR! npm  v3.10.3
npm ERR! code ELIFECYCLE

npm ERR! node-zopfli@1.4.0 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-zopfli@1.4.0 install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the node-zopfli package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-pre-gyp install --fallback-to-build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs node-zopfli
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls node-zopfli
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     E:\meteor\Grudr\npm-debug.log
vipinlahoti commented 7 years ago

any solution for this?

tashrafy commented 7 years ago

The following steps worked for me after trying many solutions:

  1. Remove your node_modules in your project directory.
  2. Run npm cache clean.
  3. Run npm install npm@latest -g.
  4. Finally, run npm install instead of yarn install.

You should be able to continue on from here and run gulp serve. (This helped me bypass the node-zopfli errors as well.)

My Specs:

Tool Version
Node v7.2.1
NPM v4.5.0
Arch 64-bit
generator-angular-fullstack v4.2.0
jsvasquez commented 7 years ago

I have the same error. I'm waiting for some solution because i've looked for in google, but really i didn't find something yet. Please, somebody help us.

vipinlahoti commented 7 years ago

@tashrafy still the same issue

tashrafy commented 7 years ago

@vipinlahoti - What are your new specs, after running the steps I outlined?

tashrafy commented 7 years ago

@jsvasquez - Can we see your specs please?

Awk34 commented 7 years ago

@vipinlahoti an error stack trace would be helpful. Also your python --version, npm config get msvs_version, & C++ build tools version

jsvasquez commented 7 years ago

Specs Node: v6.10.2 (i've had the same problem with v7.2.1) NPM: v4.5.0 Arch: 64-bit generator-angular-fullstack: v4.2.0 SO: Win7 ultimate Python: 2.7 (command "python --version" didn't work, i saw the versión in the icon) Command "msvs_version" is not working in my pc neither

npm config get ; cli configs metrics-registry = "https://registry.npmjs.org/" scope = "" user-agent = "npm/4.5.0 node/v6.10.2 win32 x64"

; globalconfig C:\Users\SebastianV\AppData\Roaming\npm\etc\npmrc msvs_version = "2015" python = "C:\Users\SebastianV\.windows-build-tools\python27\python.exe"

; builtin config undefined prefix = "C:\Users\SebastianV\AppData\Roaming\npm"

; node bin location = C:\Program Files\nodejs\node.exe ; cwd = C:\Users\SebastianV ; HOME = C:\Users\SebastianV ; "npm config ls -l" to show all defaults.

vipinlahoti commented 7 years ago

I downgraded the python from 3.6.1 to 2.7.13 and it works now 👍

jsvasquez commented 7 years ago

@vipinlahoti how did you do it?

vipinlahoti commented 7 years ago

@jsvasquez uninstalled and removed python 3.6.1 files completely, and installed 2.7.13 version, I installed node-zopfli globally as "npm install -g node-zopfli" not sure this required or not and it worked.

My specs:

Tool Version
generator-angular-fullstack v4.2.0
Node 6.3.1
npm 3.10.3
python 2.7.13
Operating System Windows 10 - 64-bit
jsvasquez commented 7 years ago

I think that my problem is in Python... because the comando "py" or "python" doesn't work. Maybe there is some bug in instalation but i don't know how find it.

IroNEDR commented 7 years ago

@vipinlahoti @jsvasquez I can confirm that this solution (installing pythong 2.7.13 => previously had 2.7.11) solved the problem.

My specs:

Tool Version
generator-angular-fullstack v4.2.0
Node v6.9.1
npm 4.5.0
python changed from 2.7.11 to 2.7.13 (solution)
OS Windows 7 64 Bit
jgrune commented 7 years ago

For anyone using Windows, I'd recommend installing Windows Build Tools. This should install python as well as a number of other tools required to build native node modules.

https://github.com/felixrieseberg/windows-build-tools

IroNEDR commented 7 years ago

@jgrune That's where I had my problematic python 2.7.11 version from

mustafakhalidcs commented 7 years ago

windows : 8.1 npm version : 3.10.3 node version: 6.6.0 python version: 2.7.13

I've upgraded my python version from 2.7.11 to 2.7.13 and also installed "npm install -g node-zopfli" and installed windows build tools but still I am facing the same issue. can anyone suggest me solution??

tashrafy commented 7 years ago

@mustafakhalidcs - Try updating your npm version to the latest (4.5.0), remove your node_modules in your project directory, and run npm install

mustafakhalidcs commented 7 years ago
180942 error code ELIFECYCLE
180943 error errno 1
180944 error node-zopfli@1.4.0 install: `node-pre-gyp install --fallback-to-build`
180944 error Exit status 1
180945 error Failed at the node-zopfli@1.4.0 install script 'node-pre-gyp install --fallback-to-build'.
180945 error Make sure you have the latest version of node.js and npm installed.
180945 error If you do, this is most likely a problem with the node-zopfli package,
180945 error not with npm itself.
180945 error Tell the author that this fails on your system:
180945 error     node-pre-gyp install --fallback-to-build
180945 error You can get information on how to open an issue for this project with:
180945 error     npm bugs node-zopfli
180945 error Or if that isn't available, you can get their info via:
180945 error     npm owner ls node-zopfli
180945 error There is likely additional logging output above.
180946 verbose exit [ 1, true ]

@tashrafy I've upgraded my npm to 4.5 version. but still getting this error?`

tsogtbayar0821 commented 7 years ago

You can use both python 2.7 and 3.5. Before run npm install, set python path.

set npm_config_python=[python 2.7 path] npm install some_package_name

ivaguilarc commented 7 years ago

Tried all the above, still not working.

tashrafy commented 7 years ago

If anything - the shrinkray library is what's installing node-zopfli - so feel free to remove it from your generated project.

ivaguilarc commented 7 years ago

Ok I managed to get it to work, I just created the environment variable PYTHON with the path to my Python 2.7.13 executable on Windows 10 and that fixed it.

blbaker commented 7 years ago

+1 for changing/installing python 2.7.13 on Windows 10

gabrielsr commented 7 years ago

When deploying to # heroku I have issue downloading node-zopfli

remote: node-pre-gyp ERR! Tried to download(403): https://node-zopfli.s3.amazonaws.com/Release/zopfli-v1.4.0-node-v48-linux-x64.tar.gz

Than a fallback starts to build de project from source. This falback also fail because 'typings' is not available in heroku environment.

I fix it by adding

  "scripts": {
    "preinstall": "npm i typings -g"
}

to my package.json

nigel-dewar commented 6 years ago

Tried all of these and nothing works. So here is what I DID, and got it working

Best thing is to simply remove shrink ray from the package.json

Then get rid of its references in server/config/express.js

ITs a pesky little package that JUST WONT INSTALL and its not just a windows 10 issue either. Its got dependecies on node-zopfli that also has issues. So all in all, its a peice of rubbish library that you ought to replace with something else.

I hope this helps others out. angular-fullstack is awesome, but this little rubbish library needs to be removed. I hope the authors do so.,

JoeKahl commented 6 years ago

Please help. One day my development works and the next day it fails due to dependencies I am not familiar with. The primary error message is stating that the expected binaries are not in the zip file on amazon. Are the files missing? Is the file name / url an unsupported version or is the zip file bad? I can manually download the same zip file https://node-zopfli.s3.amazonaws.com/Release/zopfli-v2.0.2-node-v48-win32-x64.tar.gz and inside of it there is a single file zopfli-v2.0.2-node-v48-win32-x64.tar\node-v48-win32-x64\zopfli.node

It seems like the archived tar.gz is missing the necessary files.

C:\Users\user\Source\Repos\clientservicemgmt-fe>npm install

> node-zopfli@2.0.2 install C:\Users\user\Source\Repos\clientservicemgmt-fe\node_modules\node-zopfli
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(undefined): https://node-zopfli.s3.amazonaws.com/Release/zopfli-v2.0.2-node-v48-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for node-zopfli@2.0.2 and node@6.11.1 (node-v48 ABI, unknown) (falling back to source compile with node-gyp)
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: self signed certificate in certificate chain
gyp ERR! stack     at Error (native)
gyp ERR! stack     at TLSSocket.<anonymous> (_tls_wrap.js:1092:38)
gyp ERR! stack     at emitNone (events.js:86:13)
gyp ERR! stack     at TLSSocket.emit (events.js:185:7)
gyp ERR! stack     at TLSSocket._finishInit (_tls_wrap.js:610:8)
gyp ERR! stack     at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:440:38)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\user\\Source\\Repos\\clientservicemgmt-fe\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\\Users\\user\\Source\\Repos\\clientservicemgmt-fe\\node_modules\\node-zopfli\\lib\\binding\\node-v48-win32-x64\\zopfli.node" "--module_name=zopfli" "--module_path=C:\\Users\\user\\Source\\Repos\\clientservicemgmt-fe\\node_modules\\node-zopfli\\lib\\binding\\node-v48-win32-x64" "--python=C:\\Users\\user\\.windows-build-tools\\python27\\python.exe" "--msvs_version=2015"
gyp ERR! cwd C:\Users\user\Source\Repos\clientservicemgmt-fe\node_modules\node-zopfli
gyp ERR! node -v v6.11.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\user\Source\Repos\clientservicemgmt-fe\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\user\Source\Repos\clientservicemgmt-fe\node_modules\node-zopfli\lib\binding\node-v48-win32-x64\zopfli.node --module_name=zopfli --module_path=C:\Users\user\Source\Repos\clientservicemgmt-fe\node_modules\node-zopfli\lib\binding\node-v48-win32-x64 --python=C:\Users\user\.windows-build-tools\python27\python.exe --msvs_version=2015' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\Users\user\Source\Repos\clientservicemgmt-fe\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:106:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:891:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
node-pre-gyp ERR! System Windows_NT 6.1.7601
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\user\\Source\\Repos\\clientservicemgmt-fe\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Users\user\Source\Repos\clientservicemgmt-fe\node_modules\node-zopfli
node-pre-gyp ERR! node -v v6.11.1
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
node-pre-gyp ERR! not ok
Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\user\Source\Repos\clientservicemgmt-fe\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\user\Source\Repos\clientservicemgmt-fe\node_modules\node-zopfli\lib\binding\node-v48-win32-x64\zopfli.node --module_name=zopfli --module_path=C:\Users\user\Source\Repos\clientservicemgmt-fe\node_modules\node-zopfli\lib\binding\node-v48-win32-x64 --python=C:\Users\user\.windows-build-tools\python27\python.exe --msvs_version=2015' (1)

Our firm has an internal nexus library and in that library we have the node-zopfli-2.0.2.tgz. Inside that file are many folder and files. Almost certainly the expected files. I even installed this package manually, but our Angular app / npm insists on installing from the amazonaws url where the gz has a single file inside. I do not even know where or how to intervene to make the internal library used instead of the amazonaws library.

> node-zopfli@2.0.2 install C:\Users\user\Source\Repos\clientservicemgmt-fe\node_modules\node-zopfli
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(undefined): https://node-zopfli.s3.amazonaws.com/Release/zopfli-v2.0.2-node-v48-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for node-zopfli@2.0.2 and node@6.11.1 (node-v48 ABI, unknown) (falling back to source compile with node-gyp)
gyp WARN install got an error, rolling back install
alifgithub commented 5 years ago

Please help. One day my development works and the next day it fails due to dependencies I am not familiar with. The primary error message is stating that the expected binaries are not in the zip file on amazon. Are the files missing? Is the file name / url an unsupported version or is the zip file bad? I can manually download the same zip file https://node-zopfli.s3.amazonaws.com/Release/zopfli-v2.0.2-node-v48-win32-x64.tar.gz and inside of it there is a single file zopfli-v2.0.2-node-v48-win32-x64.tar\node-v48-win32-x64\zopfli.node

It seems like the archived tar.gz is missing the necessary files.

C:\Users\user\Source\Repos\clientservicemgmt-fe>npm install

> node-zopfli@2.0.2 install C:\Users\user\Source\Repos\clientservicemgmt-fe\node_modules\node-zopfli
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(undefined): https://node-zopfli.s3.amazonaws.com/Release/zopfli-v2.0.2-node-v48-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for node-zopfli@2.0.2 and node@6.11.1 (node-v48 ABI, unknown) (falling back to source compile with node-gyp)
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: self signed certificate in certificate chain
gyp ERR! stack     at Error (native)
gyp ERR! stack     at TLSSocket.<anonymous> (_tls_wrap.js:1092:38)
gyp ERR! stack     at emitNone (events.js:86:13)
gyp ERR! stack     at TLSSocket.emit (events.js:185:7)
gyp ERR! stack     at TLSSocket._finishInit (_tls_wrap.js:610:8)
gyp ERR! stack     at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:440:38)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\user\\Source\\Repos\\clientservicemgmt-fe\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\\Users\\user\\Source\\Repos\\clientservicemgmt-fe\\node_modules\\node-zopfli\\lib\\binding\\node-v48-win32-x64\\zopfli.node" "--module_name=zopfli" "--module_path=C:\\Users\\user\\Source\\Repos\\clientservicemgmt-fe\\node_modules\\node-zopfli\\lib\\binding\\node-v48-win32-x64" "--python=C:\\Users\\user\\.windows-build-tools\\python27\\python.exe" "--msvs_version=2015"
gyp ERR! cwd C:\Users\user\Source\Repos\clientservicemgmt-fe\node_modules\node-zopfli
gyp ERR! node -v v6.11.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\user\Source\Repos\clientservicemgmt-fe\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\user\Source\Repos\clientservicemgmt-fe\node_modules\node-zopfli\lib\binding\node-v48-win32-x64\zopfli.node --module_name=zopfli --module_path=C:\Users\user\Source\Repos\clientservicemgmt-fe\node_modules\node-zopfli\lib\binding\node-v48-win32-x64 --python=C:\Users\user\.windows-build-tools\python27\python.exe --msvs_version=2015' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\Users\user\Source\Repos\clientservicemgmt-fe\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:106:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:891:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
node-pre-gyp ERR! System Windows_NT 6.1.7601
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\user\\Source\\Repos\\clientservicemgmt-fe\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Users\user\Source\Repos\clientservicemgmt-fe\node_modules\node-zopfli
node-pre-gyp ERR! node -v v6.11.1
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
node-pre-gyp ERR! not ok
Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\user\Source\Repos\clientservicemgmt-fe\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\user\Source\Repos\clientservicemgmt-fe\node_modules\node-zopfli\lib\binding\node-v48-win32-x64\zopfli.node --module_name=zopfli --module_path=C:\Users\user\Source\Repos\clientservicemgmt-fe\node_modules\node-zopfli\lib\binding\node-v48-win32-x64 --python=C:\Users\user\.windows-build-tools\python27\python.exe --msvs_version=2015' (1)

Our firm has an internal nexus library and in that library we have the node-zopfli-2.0.2.tgz. Inside that file are many folder and files. Almost certainly the expected files. I even installed this package manually, but our Angular app / npm insists on installing from the amazonaws url where the gz has a single file inside. I do not even know where or how to intervene to make the internal library used instead of the amazonaws library.

> node-zopfli@2.0.2 install C:\Users\user\Source\Repos\clientservicemgmt-fe\node_modules\node-zopfli
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(undefined): https://node-zopfli.s3.amazonaws.com/Release/zopfli-v2.0.2-node-v48-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for node-zopfli@2.0.2 and node@6.11.1 (node-v48 ABI, unknown) (falling back to source compile with node-gyp)
gyp WARN install got an error, rolling back install

have any solution for this problem ? i have the same issue

KokilaBawankar commented 5 years ago

I faced same issue on Mac. I googled it but found nothing. The problem is, it fails to download node-zopfli@2.0.2 binary at time of npm install. So I downloaded the node-zopfli from github repo having version 2.0.2 as it is the latest version. Github Repo URL : https://github.com/pierreinglebert/node-zopfli

  1. And then from its bin folder copied the zoplfi and zopflipng file and pasted it in my project's node-module/ .bin folder .
  2. Later run npm install with option build-from-source npm install --build-from-source

and things worked for me.

If you get error node-pre-gyp WARN Using request for node-pre-gyp https download node-pre-gyp ERR! UNCAUGHT EXCEPTION node-pre-gyp ERR! stack Error: ng-universal-demo package.json is not node-pre-gyp ready: node-pre-gyp ERR! stack package.json must declare these properties: node-pre-gyp ERR! stack binary.module_name node-pre-gyp ERR! stack binary.module_path node-pre-gyp ERR! stack binary.host

Then try update node-pre-gyp to it's latest version.