Comments (8)
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.
-
remove the package-lock.json
-
Install rustup
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs/ | sh
-
Install typescript globally
npm install typescript -g
-
Close all terminals
-
Open new terminal and run
npm install
from node-crc.
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.
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.
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.
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.
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.
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.
Nevertheless solving #9 would be a cleaner and better solution regarding CI/CD...
from node-crc.
Related Issues (10)
- Error: Cannot find module '../index.node' HOT 1
- crc64 can't get right answer HOT 4
- [Q] How to do a CRC8 HOT 5
- Dynamically import crc algorithm HOT 1
- Installation errors HOT 1
- How to carry out crc16 MODBUS HOT 3
- cant npm install the pacakge HOT 4
- Add changelog?
- Prebuilt binaries to avoid requiring Rust tooling everywhere HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-crc.