node2nix icon indicating copy to clipboard operation
node2nix copied to clipboard

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

Open tartavull opened this issue 3 years ago • 4 comments

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 [email protected]~postinstall: [email protected][0m
> [email protected] 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! [email protected] install: `node-gyp-build`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] 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

tartavull avatar Oct 11 '22 00:10 tartavull

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

RyanGibb avatar Nov 29 '22 13:11 RyanGibb

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

alexvorobiev avatar Sep 21 '23 01:09 alexvorobiev

@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.

RyanGibb avatar Sep 21 '23 08:09 RyanGibb

@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.

alexvorobiev avatar Oct 03 '23 23:10 alexvorobiev