svanderburg / node2nix

Generate Nix expressions to build NPM packages
MIT License
526 stars 100 forks source link

node2nix fails on blank react app "sh: line 1: node-gyp-build: command not found" #307

Open tartavull opened 2 years ago

tartavull commented 2 years ago

Hello!

It's my first time using node2nix. I've made a blank react app by calling npx create-react-app my-app. I then called node2nix and nix-build -A package which failed with the following error message after a few minutes.

...............] - : info lifecycle core-js@3.25.5~postinstall: core-js@3.2[0m
> bufferutil@4.0.6 install /nix/store/pcjmi4kv7zwjlsipr90836pc96b486rw-my-app-0.1.0/lib/node_modules/my-app/node_modules/bufferutil
> node-gyp-build

sh: line 1: node-gyp-build: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! bufferutil@4.0.6 install: `node-gyp-build`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the bufferutil@4.0.6 install 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!     /private/tmp/nix-build-my-app-0.1.0.drv-0/.npm/_logs/2022-10-11T00_03_50_752Z-debug.log
RyanGibb commented 1 year ago

I'm having the same problem trying to port an existing app to nix.

alexvorobiev commented 1 year ago

I am having the same issue and looking at the commit history it feels like node2nix is abandoned. What are the alternatives?

RyanGibb commented 1 year ago

@alexvorobiev I haven't used it myself, so I don't know what state it's in, but https://github.com/nix-community/dream2nix might be a possibility.

alexvorobiev commented 1 year ago

@RyanGibb Yes I know about that one but from the documentation it feels like that is going to be some learning curve. Also the only documentation for node is under "v1" and only visible in the repo, not on the documentation site, so it is not clear whether it is obsolete or not.