Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It does not build anymore, neither in Windows 10 nor on linux. #63

Open
Spinlogic opened this issue Jan 3, 2024 · 2 comments
Open

It does not build anymore, neither in Windows 10 nor on linux. #63

Spinlogic opened this issue Jan 3, 2024 · 2 comments

Comments

@Spinlogic
Copy link

Spinlogic commented Jan 3, 2024

It looks like this package is not being maintained, is it?
I could build it a couple of years ago for some tests I did back then, but I can't succeed anymore using updated versions of all tools. For Windows 10, my setup has:

  • Go v1.21.5
  • Node v21.1
  • Python 3.11
  • make from cygwin v2.926 (GNU Make 4.4.1)

When I run "yarn add uplink-nodejs", I get:

PS > yarn add uplink-nodejs
yarn add v1.22.21
[1/4] Resolving packages...
⠂ uplink-nodejs(node:10956) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
warning uplink-nodejs > node-gyp > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
warning uplink-nodejs > node-gyp > request > har-validator@5.1.5: this library is no longer supported
warning uplink-nodejs > node-gyp > request > uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
[2/4] Fetching packages...
warning Pattern ["strip-ansi@^6.0.1"] is trying to unpack in the same destination "C:\\Users\\juann\\AppData\\Local\\Yarn\\Cache\\v6\\npm-strip-ansi-cjs-6.0.1-9e26c63d30f53443e9489495b2105d37b67a85d9-integrity\\node_modules\\strip-ansi-cjs" as pattern ["strip-ansi-cjs@npm:strip-ansi@^6.0.1"]. This could result in non-deterministic behavior, skipping.
warning Pattern ["string-width@^4.1.0"] is trying to unpack in the same destination "C:\\Users\\juann\\AppData\\Local\\Yarn\\Cache\\v6\\npm-string-width-cjs-4.2.3-269c7117d27b05ad2e536830a8ec895ef9c6d010-integrity\\node_modules\\string-width-cjs" as pattern ["string-width-cjs@npm:string-width@^4.2.0"]. This could result in non-deterministic behavior, skipping.
warning Pattern ["strip-ansi@^6.0.0"] is trying to unpack in the same destination "C:\\Users\\juann\\AppData\\Local\\Yarn\\Cache\\v6\\npm-strip-ansi-cjs-6.0.1-9e26c63d30f53443e9489495b2105d37b67a85d9-integrity\\node_modules\\strip-ansi-cjs" as pattern ["strip-ansi-cjs@npm:strip-ansi@^6.0.1"]. This could result in non-deterministic behavior, skipping.
warning Pattern ["string-width@^4.2.3"] is trying to unpack in the same destination "C:\\Users\\juann\\AppData\\Local\\Yarn\\Cache\\v6\\npm-string-width-cjs-4.2.3-269c7117d27b05ad2e536830a8ec895ef9c6d010-integrity\\node_modules\\string-width-cjs" as pattern ["string-width-cjs@npm:string-width@^4.2.0"]. This could result in non-deterministic behavior, skipping.
warning Pattern ["string-width@^4.2.0"] is trying to unpack in the same destination "C:\\Users\\juann\\AppData\\Local\\Yarn\\Cache\\v6\\npm-string-width-cjs-4.2.3-269c7117d27b05ad2e536830a8ec895ef9c6d010-integrity\\node_modules\\string-width-cjs" as pattern ["string-width-cjs@npm:string-width@^4.2.0"]. This could result in non-deterministic behavior, skipping.
warning Pattern ["string-width@^1.0.2 || 2 || 3 || 4"] is trying to unpack in the same destination "C:\\Users\\juann\\AppData\\Local\\Yarn\\Cache\\v6\\npm-string-width-cjs-4.2.3-269c7117d27b05ad2e536830a8ec895ef9c6d010-integrity\\node_modules\\string-width-cjs" as pattern ["string-width-cjs@npm:string-width@^4.2.0"]. This could result in non-deterministic behavior, skipping.
warning Pattern ["wrap-ansi@^7.0.0"] is trying to unpack in the same destination "C:\\Users\\juann\\AppData\\Local\\Yarn\\Cache\\v6\\npm-wrap-ansi-cjs-7.0.0-67e145cff510a6a6984bdf1152911d69d2eb9e43-integrity\\node_modules\\wrap-ansi-cjs" as pattern ["wrap-ansi-cjs@npm:wrap-ansi@^7.0.0"]. This could result in non-deterministic behavior, skipping.
[3/4] Linking dependencies...
warning Workspaces can only be enabled in private projects.
[4/4] Building fresh packages...
[2/2] ⠐ uplink-nodejs
error C:\Users\juann\OneDrive\Documents\GitHub\yaluba-art\backend\factory\node_modules\uplink-nodejs: Command failed.
Exit code: 2
Command: make
Arguments:
Directory: C:\Users\juann\OneDrive\Documents\GitHub\yaluba-art\backend\factory\node_modules\uplink-nodejs
Output:
git clone -b v1.2.2 https://github.com/storj/uplink-c
Cloning into 'uplink-c'...
Note: switching to 'f6073cab8a5a9c548a5e8589593df08fbb3636c8'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

(cd uplink-c) && (go build -o ../libuplinkcv1.2.4.dll -buildmode=c-shared) && (move *.h ../)
go: cannot find main module, but found .git/config in C:\Users\juann\OneDrive\Documents\GitHub\yaluba-art
        to create a module there, run:
        cd ..\..\..\.. && go mod init
make: *** [Makefile:30: build] Error 1

I tried clonning the "uplink-nodejs" repo from github and running "npm run preinstall", with exactly the same outcome.

Then I tried building docker images based on node:21-bookworm and node:21-alpine , adding golang, make and python support to them. But it always fails when building uplink-nodejs.
For debian bookworm, you can try with a dockerfile like:

FROM node:21-bookworm

COPY --from=golang:1.21.5-bookworm /usr/local/go/ /usr/local/go/

ENV PATH="/usr/local/go/bin:${PATH}"
ENV GOPATH /go
ENV PATH $GOPATH/bin:$PATH
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"

RUN apt-get update
RUN apt-get install -y --no-install-recommends make python3

WORKDIR /app

COPY . .

RUN npm install

with a copied package.json file that includes:

"dependencies": { ... "node-gyp": "^10.0.1", "uplink-nodejs": "^1.2.6", ... }
For this dockerfile what I get when trying to build the image is:

PS > docker build -t test_factory .
[+] Building 87.8s (14/14) FINISHED                                                                                                                                                                                                                             docker:default 
 => [internal] load build definition from dockerfile                                                                                                                                                                                                                      0.1s 
 => => transferring dockerfile: 427B                                                                                                                                                                                                                                      0.0s 
 => [internal] load .dockerignore                                                                                                                                                                                                                                         0.2s 
 => => transferring context: 68B                                                                                                                                                                                                                                          0.0s 
 => [internal] load metadata for docker.io/library/golang:1.21.5-bookworm                                                                                                                                                                                                 1.6s 
 => [internal] load metadata for docker.io/library/node:21-bookworm                                                                                                                                                                                                       1.2s 
 => FROM docker.io/library/golang:1.21.5-bookworm@sha256:1415bb0b25d3bffc0a44dcf9851c20a9f8bbe558095221d931f2e4a4cc3596eb                                                                                                                                                 0.0s 
 => [stage-0 1/8] FROM docker.io/library/node:21-bookworm@sha256:73a9c498369c6e6f864359979c8f4895f28323c07411605e6c870d696a0143fa                                                                                                                                         0.0s 
 => [internal] load build context                                                                                                                                                                                                                                         0.0s 
 => => transferring context: 835B                                                                                                                                                                                                                                         0.0s 
 => CACHED [stage-0 2/8] COPY --from=golang:1.21.5-bookworm /usr/local/go/ /usr/local/go/                                                                                                                                                                                 0.0s 
 => CACHED [stage-0 3/8] RUN mkdir -p "/go/src" "/go/bin" && chmod -R 777 "/go"                                                                                                                                                                                           0.0s 
 => CACHED [stage-0 4/8] RUN apt-get update                                                                                                                                                                                                                               0.0s 
 => CACHED [stage-0 5/8] RUN apt-get install -y --no-install-recommends make python3                                                                                                                                                                                      0.0s 
 => CACHED [stage-0 6/8] WORKDIR /app                                                                                                                                                                                                                                     0.0s 
 => CACHED [stage-0 7/8] COPY . .                                                                                                                                                                                                                                         0.0s 
 => ERROR [stage-0 8/8] RUN npm install                                                                                                                                                                                                                                  85.8s 
------
 > [stage-0 8/8] RUN npm install:
32.18 npm WARN deprecated har-validator@5.1.5: this library is no longer supported
33.99 npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
34.45 npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
84.75 npm notice
84.75 npm notice New patch version of npm available! 10.2.4 -> 10.2.5
84.75 npm notice Changelog: <https://github.com/npm/cli/releases/tag/v10.2.5>
84.75 npm notice Run `npm install -g npm@10.2.5` to update!
84.75 npm notice
84.75 npm ERR! code 7
84.76 npm ERR! path /app/node_modules/uplink-nodejs
84.76 npm ERR! command failed
84.76 npm ERR! command sh -c (node-gyp configure) && (node-gyp rebuild)
84.76 npm ERR! gyp info it worked if it ends with ok
84.76 npm ERR! gyp info using node-gyp@7.1.2
84.76 npm ERR! gyp info using node@21.5.0 | linux | x64
84.76 npm ERR! gyp info find Python using Python version 3.11.2 found at "/usr/bin/python3"
84.76 npm ERR! (node:2125) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
84.76 npm ERR! (Use `node --trace-deprecation ...` to show where the warning was created)
84.76 npm ERR! gyp http GET https://nodejs.org/download/release/v21.5.0/node-v21.5.0-headers.tar.gz
84.76 npm ERR! gyp http 200 https://nodejs.org/download/release/v21.5.0/node-v21.5.0-headers.tar.gz
84.76 npm ERR! gyp http GET https://nodejs.org/download/release/v21.5.0/SHASUMS256.txt
84.76 npm ERR! gyp http 200 https://nodejs.org/download/release/v21.5.0/SHASUMS256.txt
84.76 npm ERR! gyp ERR! UNCAUGHT EXCEPTION
84.76 npm ERR! gyp ERR! stack TypeError: Cannot assign to read only property 'cflags' of object '#<Object>'
84.76 npm ERR! gyp ERR! stack     at createConfigFile (/app/node_modules/uplink-nodejs/node_modules/node-gyp/lib/configure.js:117:21)
84.76 npm ERR! gyp ERR! stack     at /app/node_modules/uplink-nodejs/node_modules/node-gyp/lib/configure.js:84:9
84.76 npm ERR! gyp ERR! stack     at FSReqCallback.oncomplete (node:fs:191:23)
84.76 npm ERR! gyp ERR! System Linux 5.15.133.1-microsoft-standard-WSL2
84.76 npm ERR! gyp ERR! command "/usr/local/bin/node" "/app/node_modules/uplink-nodejs/node_modules/.bin/node-gyp" "configure"
84.76 npm ERR! gyp ERR! cwd /app/node_modules/uplink-nodejs
84.76 npm ERR! gyp ERR! node -v v21.5.0
84.76 npm ERR! gyp ERR! node-gyp -v v7.1.2
84.76 npm ERR! gyp ERR! Node-gyp failed to build your package.
84.76 npm ERR! gyp ERR! Try to update npm and/or node-gyp and if it does not help file an issue with the package author.
84.76
84.76 npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2024-01-03T18_19_52_482Z-debug-0.log
------
dockerfile:17
--------------------
  15 |     COPY . .
  16 |
  17 | >>> RUN npm install
  18 |
  19 |     EXPOSE 7001
--------------------
ERROR: failed to solve: process "/bin/sh -c npm install" did not complete successfully: exit code: 7

I wanted to use STORJ for this project, but with NodeJS, neither the uplink nor the AWS-S3 solutions work for me. Only valid option seems to be Golang.

@DmitrySmv
Copy link

Use this package from npm:
https://www.npmjs.com/package/@super-protocol/uplink-nodejs

This problem was fixed in this fork.

@kmozurkewich
Copy link
Member

This package it not actively maintained, however, we always welcome PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants