Git Product home page Git Product logo

Comments (8)

hk-tony avatar hk-tony commented on May 20, 2024 1

I just ran into the same issue and made it work by the following steps on my M1 Pro Macbook Pro.
Not sure if it helps for others.

  1. remove the package-lock.json

  2. Install rustup
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs/ | sh

  3. Install typescript globally
    npm install typescript -g

  4. Close all terminals

  5. Open new terminal and run npm install

from node-crc.

rafaelmaeuer avatar rafaelmaeuer commented on May 20, 2024 1

Thanks @hk-tony I was finally able to get v2 running with following steps:

Add typescript as dev-dependency to package.json

yarn add typescript --dev

Install rustup toolchain on MacOS

# for Intel or M1 macs
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs/ | sh

Add rustup toolchain to Docker

# for alpine-based images
RUN apk add rustup build-base
RUN rustup-init -y
ENV PATH "/root/.cargo/bin:$PATH"
ENV RUSTFLAGS="-C target-feature=-crt-static"

from node-crc.

magiclen avatar magiclen commented on May 20, 2024

You need to set up the development environment for Rust to compile the binary.

You can simply install rustup with this command: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh. By default, it would also install the stable Rust compiler and the cargo command tool, which should be enough to build/install this project.

from node-crc.

rafaelmaeuer avatar rafaelmaeuer commented on May 20, 2024

After installing rustup, I get another error (macOS 11.4, node 16.5.0, npm 7.20.0, yarn 1.23.0):

error /Users/<project-path>/node_modules/node-crc: Command failed.
Exit code: 127
Command: npm run build
Arguments: 
Directory: /Users/<project-path>/node_modules/node-crc
Output:
> [email protected] build
> cargo-cp-artifact -nc index.node -- cargo build --release --message-format=json-render-diagnostics && tsc

    Updating crates.io index
   Compiling typenum v1.13.0
   Compiling proc-macro2 v1.0.27
   Compiling version_check v0.9.3
   Compiling unicode-xid v0.2.2
   Compiling neon-build v0.8.3
   Compiling syn v1.0.73
   Compiling stable_deref_trait v1.2.0
   Compiling cfg-if v1.0.0
   Compiling byteorder v1.4.3
   Compiling heapless v0.5.6
   Compiling semver-parser v0.7.0
   Compiling smallvec v1.6.1
   Compiling cslice v0.2.0
   Compiling libloading v0.6.7
   Compiling hash32 v0.1.1
   Compiling semver v0.9.0
   Compiling generic-array v0.14.4
   Compiling neon-runtime v0.8.3
   Compiling neon v0.8.3
   Compiling quote v1.0.9
   Compiling generic-array v0.12.4
   Compiling generic-array v0.13.3
   Compiling as-slice v0.1.5
   Compiling crc-any v2.3.12
   Compiling neon-macros v0.8.3

from node-crc.

rafaelmaeuer avatar rafaelmaeuer commented on May 20, 2024

On docker build with github-actions I get:

error /web/app/node_modules/node-crc: Command failed.
Exit code: 101
Command: npm run build
Arguments: 
Directory: /web/app/node_modules/node-crc
Output:
npm WARN lifecycle The node binary used for scripts is /tmp/yarn--1626782438614-0.7731101187450118/node but npm is using /usr/local/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

> [email protected] build /web/app/node_modules/node-crc
> cargo-cp-artifact -nc index.node -- cargo build --release --message-format=json-render-diagnostics && tsc

    Updating crates.io index
 Downloading crates ...
  Downloaded crc-any v2.3.12
  Downloaded neon v0.8.3
  Downloaded heapless v0.5.6
  Downloaded smallvec v1.6.1
  Downloaded cslice v0.2.0
  Downloaded neon-build v0.8.3
  Downloaded semver v0.9.0
  Downloaded neon-runtime v0.8.3
  Downloaded neon-macros v0.8.3
  Downloaded generic-array v0.13.3
  Downloaded stable_deref_trait v1.2.0
  Downloaded as-slice v0.1.5
  Downloaded quote v1.0.9
  Downloaded cfg-if v1.0.0
  Downloaded semver-parser v0.7.0
  Downloaded syn v1.0.73
  Downloaded libloading v0.6.7
  Downloaded generic-array v0.14.4
  Downloaded proc-macro2 v1.0.27
  Downloaded typenum v1.13.0
  Downloaded generic-array v0.12.4
  Downloaded hash32 v0.1.1
  Downloaded unicode-xid v0.2.2
  Downloaded version_check v0.9.3
  Downloaded byteorder v1.4.3
   Compiling typenum v1.13.0
   Compiling proc-macro2 v1.0.27
   Compiling version_check v0.9.3
   Compiling unicode-xid v0.2.2
   Compiling neon-build v0.8.3
   Compiling syn v1.0.73
   Compiling cfg-if v1.0.0
   Compiling byteorder v1.4.3
   Compiling stable_deref_trait v1.2.0
   Compiling heapless v0.5.6
   Compiling smallvec v1.6.1
   Compiling semver-parser v0.7.0
   Compiling cslice v0.2.0
   Compiling generic-array v0.14.4
   Compiling libloading v0.6.7
error[E0658]: the `#[non_exhaustive]` attribute is an experimental feature
  --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/libloading-0.6.7/src/error.rs:23:1
   |
23 | #[non_exhaustive]
   | ^^^^^^^^^^^^^^^^^
   |
   = note: for more information, see https://github.com/rust-lang/rust/issues/44109

error: aborting due to previous error

from node-crc.

magiclen avatar magiclen commented on May 20, 2024

error[E0658]: the #[non_exhaustive] attribute is an experimental feature

It seems that your Rust is too old... (see https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1400-2019-12-19)

You don't need to use docker. Just run curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh to install Rust and Cargo into your environment.

from node-crc.

rafaelmaeuer avatar rafaelmaeuer commented on May 20, 2024

ok but I do use docker in my build pipeline, so updating this dependency to v2 requires me to integrate rust, if not someone will perform suggestions of #9 eventually

from node-crc.

rafaelmaeuer avatar rafaelmaeuer commented on May 20, 2024

Nevertheless solving #9 would be a cleaner and better solution regarding CI/CD...

from node-crc.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.