Beggars
Beggars
RRailway
Created by Beggars on 5/25/2023 in #✋|help
Node.js 18 and node-gyp compatibility
Sounds great. Thank you for not only your fast response but your patience in getting this sorted out as well.
108 replies
RRailway
Created by Beggars on 5/25/2023 in #✋|help
Node.js 18 and node-gyp compatibility
Okay. So, what I am going to do is write up a Markdown document. And then, if you's want to take it and put it somewhere in the docs on the site, might save you a tonne of time in the future, because I know node-gyp is a pain for Node.js users.
108 replies
RRailway
Created by Beggars on 5/25/2023 in #✋|help
Node.js 18 and node-gyp compatibility
Brody, you're a genius.
108 replies
RRailway
Created by Beggars on 5/25/2023 in #✋|help
Node.js 18 and node-gyp compatibility
Oh shit. I think this worked.
108 replies
RRailway
Created by Beggars on 5/25/2023 in #✋|help
Node.js 18 and node-gyp compatibility
Haha
108 replies
RRailway
Created by Beggars on 5/25/2023 in #✋|help
Node.js 18 and node-gyp compatibility
Okay, that made some progress. Man, node-gyp really is a stain on the Node.js ecosystem, huh? I have no idea what any of this even means, haha.
#12 22.94 npm ERR! gyp http 200 https://nodejs.org/download/release/v18.12.1/SHASUMS256.txt
#12 22.94 npm ERR! gyp info spawn /root/.nix-profile/bin/python3
#12 22.94 npm ERR! gyp info spawn args [
#12 22.94 npm ERR! gyp info spawn args '/app/node_modules/node-gyp/gyp/gyp_main.py',
#12 22.94 npm ERR! gyp info spawn args 'binding.gyp',
#12 22.94 npm ERR! gyp info spawn args '-f',
#12 22.94 npm ERR! gyp info spawn args 'make',
#12 22.94 npm ERR! gyp info spawn args '-I',
#12 22.94 npm ERR! gyp info spawn args '/app/node_modules/hnswlib-node/build/config.gypi',
#12 22.94 npm ERR! gyp info spawn args '-I',
#12 22.94 npm ERR! gyp info spawn args '/app/node_modules/node-gyp/addon.gypi',
#12 22.94 npm ERR! gyp info spawn args '-I',
#12 22.94 npm ERR! gyp info spawn args '/root/.cache/node-gyp/18.12.1/include/node/common.gypi',
#12 22.94 npm ERR! gyp info spawn args '-Dlibrary=shared_library',
#12 22.94 npm ERR! gyp info spawn args '-Dvisibility=default',
#12 22.94 npm ERR! gyp info spawn args '-Dnode_root_dir=/root/.cache/node-gyp/18.12.1',
#12 22.94 npm ERR! gyp info spawn args '-Dnode_gyp_dir=/app/node_modules/node-gyp',
#12 22.94 npm ERR! gyp info spawn args '-Dnode_lib_file=/root/.cache/node-gyp/18.12.1/<(target_arch)/node.lib',
#12 22.94 npm ERR! gyp info spawn args '-Dmodule_root_dir=/app/node_modules/hnswlib-node',
#12 22.94 npm ERR! gyp info spawn args '-Dnode_engine=v8',
#12 22.94 npm ERR! gyp info spawn args '--depth=.',
#12 22.94 npm ERR! gyp info spawn args '--no-parallel',
#12 22.94 npm ERR! gyp info spawn args '--generator-output',
#12 22.94 npm ERR! gyp info spawn args 'build',
#12 22.94 npm ERR! gyp info spawn args '-Goutput_dir=.'
#12 22.94 npm ERR! gyp info spawn args ]
#12 22.94 npm ERR! gyp info spawn make
#12 22.94 npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
#12 22.94 npm ERR! make: g++: No such file or directory
#12 22.94 npm ERR! make: *** [addon.target.mk:109: Release/obj.target/addon/src/addon.o] Error 127
#12 22.94 npm ERR! gyp ERR! build error
#12 22.94 npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
#12 22.94 npm ERR! gyp ERR! stack at ChildProcess.onExit (/app/node_modules/node-gyp/lib/build.js:194:23)
#12 22.94 npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:513:28)
#12 22.94 npm ERR! gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:291:12)
#12 22.94 npm ERR! gyp http 200 https://nodejs.org/download/release/v18.12.1/SHASUMS256.txt
#12 22.94 npm ERR! gyp info spawn /root/.nix-profile/bin/python3
#12 22.94 npm ERR! gyp info spawn args [
#12 22.94 npm ERR! gyp info spawn args '/app/node_modules/node-gyp/gyp/gyp_main.py',
#12 22.94 npm ERR! gyp info spawn args 'binding.gyp',
#12 22.94 npm ERR! gyp info spawn args '-f',
#12 22.94 npm ERR! gyp info spawn args 'make',
#12 22.94 npm ERR! gyp info spawn args '-I',
#12 22.94 npm ERR! gyp info spawn args '/app/node_modules/hnswlib-node/build/config.gypi',
#12 22.94 npm ERR! gyp info spawn args '-I',
#12 22.94 npm ERR! gyp info spawn args '/app/node_modules/node-gyp/addon.gypi',
#12 22.94 npm ERR! gyp info spawn args '-I',
#12 22.94 npm ERR! gyp info spawn args '/root/.cache/node-gyp/18.12.1/include/node/common.gypi',
#12 22.94 npm ERR! gyp info spawn args '-Dlibrary=shared_library',
#12 22.94 npm ERR! gyp info spawn args '-Dvisibility=default',
#12 22.94 npm ERR! gyp info spawn args '-Dnode_root_dir=/root/.cache/node-gyp/18.12.1',
#12 22.94 npm ERR! gyp info spawn args '-Dnode_gyp_dir=/app/node_modules/node-gyp',
#12 22.94 npm ERR! gyp info spawn args '-Dnode_lib_file=/root/.cache/node-gyp/18.12.1/<(target_arch)/node.lib',
#12 22.94 npm ERR! gyp info spawn args '-Dmodule_root_dir=/app/node_modules/hnswlib-node',
#12 22.94 npm ERR! gyp info spawn args '-Dnode_engine=v8',
#12 22.94 npm ERR! gyp info spawn args '--depth=.',
#12 22.94 npm ERR! gyp info spawn args '--no-parallel',
#12 22.94 npm ERR! gyp info spawn args '--generator-output',
#12 22.94 npm ERR! gyp info spawn args 'build',
#12 22.94 npm ERR! gyp info spawn args '-Goutput_dir=.'
#12 22.94 npm ERR! gyp info spawn args ]
#12 22.94 npm ERR! gyp info spawn make
#12 22.94 npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
#12 22.94 npm ERR! make: g++: No such file or directory
#12 22.94 npm ERR! make: *** [addon.target.mk:109: Release/obj.target/addon/src/addon.o] Error 127
#12 22.94 npm ERR! gyp ERR! build error
#12 22.94 npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
#12 22.94 npm ERR! gyp ERR! stack at ChildProcess.onExit (/app/node_modules/node-gyp/lib/build.js:194:23)
#12 22.94 npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:513:28)
#12 22.94 npm ERR! gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:291:12)
108 replies
RRailway
Created by Beggars on 5/25/2023 in #✋|help
Node.js 18 and node-gyp compatibility
Haha, yes. A community blog or wiki would be great.
108 replies
RRailway
Created by Beggars on 5/25/2023 in #✋|help
Node.js 18 and node-gyp compatibility
If this all works out, do you know if there is a way I can contribute back to Railway docs and write up some docs on dealing with Node.js and node-gyp issues?
108 replies
RRailway
Created by Beggars on 5/25/2023 in #✋|help
Node.js 18 and node-gyp compatibility
Installing Python would sort it I think.
108 replies
RRailway
Created by Beggars on 5/25/2023 in #✋|help
Node.js 18 and node-gyp compatibility
Oh, that would be awesome if that's possible.
108 replies
RRailway
Created by Beggars on 5/25/2023 in #✋|help
Node.js 18 and node-gyp compatibility
I think it uses Python to build it or something. You've given me an idea to see if there is a way to specify a non-source version of it actually.
108 replies
RRailway
Created by Beggars on 5/25/2023 in #✋|help
Node.js 18 and node-gyp compatibility
I do actually. It's the hnswlib-node dependency.
108 replies
RRailway
Created by Beggars on 5/25/2023 in #✋|help
Node.js 18 and node-gyp compatibility
{
"name": "askaurelia",
"version": "0.0.1",
"description": "",
"author": "",
"private": true,
"license": "UNLICENSED",
"scripts": {
"build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"start": "nest start",
"start:dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest",
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json"
},
"engines": {
"node": "18.x"
},
"dependencies": {
"@nestjs/common": "^9.0.0",
"@nestjs/config": "^2.3.2",
"@nestjs/core": "^9.0.0",
"@nestjs/jwt": "^10.0.3",
"@nestjs/passport": "^9.0.3",
"@nestjs/platform-express": "^9.0.0",
"@nestjs/typeorm": "^9.0.1",
"@octokit/rest": "^19.0.11",
"dotenv": "^16.0.3",
"hnswlib-node": "^1.4.2",
"jwt-simple": "^0.5.6",
"langchain": "^0.0.81",
"passport": "^0.6.0",
"passport-github2": "^0.1.12",
"passport-google-oauth20": "^2.0.0",
"passport-jwt": "^4.0.1",
"pg": "^8.11.0",
"reflect-metadata": "^0.1.13",
"rxjs": "^7.2.0",
"sqlite3": "^5.1.6",
"typeorm": "^0.3.16"
},
"devDependencies": {
"@nestjs/cli": "^9.0.0",
"@nestjs/schematics": "^9.0.0",
"@nestjs/testing": "^9.0.0",
"@types/express": "^4.17.13",
"@types/jest": "29.5.1",
"@types/node": "18.16.12",
"@types/supertest": "^2.0.11",
"@typescript-eslint/eslint-plugin": "^5.0.0",
"@typescript-eslint/parser": "^5.0.0",
"eslint": "^8.0.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
"jest": "29.5.0",
"prettier": "^2.3.2",
"source-map-support": "^0.5.20",
"supertest": "^6.1.3",
"ts-jest": "29.1.0",
"ts-loader": "^9.2.3",
"ts-node": "^10.0.0",
"tsconfig-paths": "4.2.0",
"typescript": "^5.0.0"
},
"jest": {
"moduleFileExtensions": [
"js",
"json",
"ts"
],
"rootDir": "src",
"testRegex": ".*\\.spec\\.ts$",
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
},
"collectCoverageFrom": [
"**/*.(t|j)s"
],
"coverageDirectory": "../coverage",
"testEnvironment": "node"
}
}
{
"name": "askaurelia",
"version": "0.0.1",
"description": "",
"author": "",
"private": true,
"license": "UNLICENSED",
"scripts": {
"build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"start": "nest start",
"start:dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest",
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json"
},
"engines": {
"node": "18.x"
},
"dependencies": {
"@nestjs/common": "^9.0.0",
"@nestjs/config": "^2.3.2",
"@nestjs/core": "^9.0.0",
"@nestjs/jwt": "^10.0.3",
"@nestjs/passport": "^9.0.3",
"@nestjs/platform-express": "^9.0.0",
"@nestjs/typeorm": "^9.0.1",
"@octokit/rest": "^19.0.11",
"dotenv": "^16.0.3",
"hnswlib-node": "^1.4.2",
"jwt-simple": "^0.5.6",
"langchain": "^0.0.81",
"passport": "^0.6.0",
"passport-github2": "^0.1.12",
"passport-google-oauth20": "^2.0.0",
"passport-jwt": "^4.0.1",
"pg": "^8.11.0",
"reflect-metadata": "^0.1.13",
"rxjs": "^7.2.0",
"sqlite3": "^5.1.6",
"typeorm": "^0.3.16"
},
"devDependencies": {
"@nestjs/cli": "^9.0.0",
"@nestjs/schematics": "^9.0.0",
"@nestjs/testing": "^9.0.0",
"@types/express": "^4.17.13",
"@types/jest": "29.5.1",
"@types/node": "18.16.12",
"@types/supertest": "^2.0.11",
"@typescript-eslint/eslint-plugin": "^5.0.0",
"@typescript-eslint/parser": "^5.0.0",
"eslint": "^8.0.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
"jest": "29.5.0",
"prettier": "^2.3.2",
"source-map-support": "^0.5.20",
"supertest": "^6.1.3",
"ts-jest": "29.1.0",
"ts-loader": "^9.2.3",
"ts-node": "^10.0.0",
"tsconfig-paths": "4.2.0",
"typescript": "^5.0.0"
},
"jest": {
"moduleFileExtensions": [
"js",
"json",
"ts"
],
"rootDir": "src",
"testRegex": ".*\\.spec\\.ts$",
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
},
"collectCoverageFrom": [
"**/*.(t|j)s"
],
"coverageDirectory": "../coverage",
"testEnvironment": "node"
}
}
108 replies
RRailway
Created by Beggars on 5/25/2023 in #✋|help
Node.js 18 and node-gyp compatibility
I thought maybe something good was happening, but alas:
#12 23.97 npm ERR! code 1
#12 23.97 npm ERR! path /app/node_modules/hnswlib-node
#12 23.97 npm ERR! command failed
#12 23.97 npm ERR! command sh -c -- node-gyp rebuild
#12 23.97 npm ERR! gyp info it worked if it ends with ok
#12 23.97 npm ERR! gyp info using [email protected]
#12 23.97 npm ERR! gyp info using [email protected] | linux | x64
#12 23.97 npm ERR! gyp ERR! find Python
#12 23.97 npm ERR! gyp ERR! find Python Python is not set from command line or npm configuration
#12 23.97 npm ERR! gyp ERR! find Python Python is not set from environment variable PYTHON
#12 23.97 npm ERR! gyp ERR! find Python checking if "python3" can be used
#12 23.97 npm ERR! gyp ERR! find Python - "python3" is not in PATH or produced an error
#12 23.97 npm ERR! gyp ERR! find Python checking if "python" can be used
#12 23.97 npm ERR! gyp ERR! find Python - "python" is not in PATH or produced an error
#12 23.97 npm ERR! gyp ERR! find Python
#12 23.97 npm ERR! gyp ERR! find Python **********************************************************
#12 23.97 npm ERR! gyp ERR! find Python You need to install the latest version of Python.
#12 23.97 npm ERR! gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
#12 23.97 npm ERR! gyp ERR! find Python you can try one of the following options:
#12 23.97 npm ERR! code 1
#12 23.97 npm ERR! path /app/node_modules/hnswlib-node
#12 23.97 npm ERR! command failed
#12 23.97 npm ERR! command sh -c -- node-gyp rebuild
#12 23.97 npm ERR! gyp info it worked if it ends with ok
#12 23.97 npm ERR! gyp info using [email protected]
#12 23.97 npm ERR! gyp info using [email protected] | linux | x64
#12 23.97 npm ERR! gyp ERR! find Python
#12 23.97 npm ERR! gyp ERR! find Python Python is not set from command line or npm configuration
#12 23.97 npm ERR! gyp ERR! find Python Python is not set from environment variable PYTHON
#12 23.97 npm ERR! gyp ERR! find Python checking if "python3" can be used
#12 23.97 npm ERR! gyp ERR! find Python - "python3" is not in PATH or produced an error
#12 23.97 npm ERR! gyp ERR! find Python checking if "python" can be used
#12 23.97 npm ERR! gyp ERR! find Python - "python" is not in PATH or produced an error
#12 23.97 npm ERR! gyp ERR! find Python
#12 23.97 npm ERR! gyp ERR! find Python **********************************************************
#12 23.97 npm ERR! gyp ERR! find Python You need to install the latest version of Python.
#12 23.97 npm ERR! gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
#12 23.97 npm ERR! gyp ERR! find Python you can try one of the following options:
108 replies
RRailway
Created by Beggars on 5/25/2023 in #✋|help
Node.js 18 and node-gyp compatibility
Ah, cool. Always good to not have to configure things.
108 replies
RRailway
Created by Beggars on 5/25/2023 in #✋|help
Node.js 18 and node-gyp compatibility
Ah, gotcha. I didn't realise that. This is my railway.json file: { "$schema": "https://railway.app/railway.schema.json", "build": { "builder": "NIXPACKS", "buildCommand": "npm run build" }, "deploy": { "numReplicas": 1, "startCommand": "npm start", "restartPolicyType": "ON_FAILURE", "restartPolicyMaxRetries": 10 } }
108 replies
RRailway
Created by Beggars on 5/25/2023 in #✋|help
Node.js 18 and node-gyp compatibility
Yeah, you were right. Gyp issue still prevalent. I don't seem to have a railway.json file because I created the project through the web interface and then linked it using railway link in my project.
108 replies
RRailway
Created by Beggars on 5/25/2023 in #✋|help
Node.js 18 and node-gyp compatibility
@Brody That was an incredibly fast response. Thank you. I'll see if bumping Node.js version to 18 maybe fixes the issue with the package.
108 replies
RRailway
Created by Beggars on 5/25/2023 in #✋|help
Node.js 18 and node-gyp compatibility
dc2d2825-bef5-4c42-8d8b-646d7f1898f9
108 replies