I am working on a Node.js project and using rspeedy for development. The project is built using a new programming language and framework, and you can find more information on the Lynx Family GitHub page: .
When I run npm run dev
, I get the following error:
PS D:\LYNX\lynx_first_project\bakakr> npm run dev
> [email protected] dev
> rspeedy dev
Rspeedy v0.8.2 (Rsbuild v1.2.11, Rspack v1.2.3)
start Building...
error Compile error:
Failed to compile, check the errors for troubleshooting.
× Error: Cannot find module 'D:\LYNX\lynx_first_project\bakakr\node_modules\@lynx-js\tasm\build\win32\Release\lepus.node'
│ Require stack:
│ - D:\LYNX\lynx_first_project\bakakr\node_modules\@lynx-js\tasm\index.js
│ at Module._resolveFilename (node:internal/modules/cjs/loader:1140:15)
│ at Module._load (node:internal/modules/cjs/loader:981:27)
│ at Module.require (node:internal/modules/cjs/loader:1231:19)
│ at require (node:internal/modules/helpers:177:18)
│ at encode_napi (D:\LYNX\lynx_first_project\bakakr\node_modules\@lynx-js\tasm\index.js:48:17)
│ at Object.fn (file:///D:/LYNX/lynx_first_project/bakakr/node_modules/@lynx-js/template-webpack-plugin/lib/LynxEncodePlugin
Steps I’ve tried to resolve the issue so far:
- Re-running
npm install
to ensure all dependencies are installed. - Deleting
node_modules
andpackage-lock.json
, then runningnpm install
again. - Running
npm rebuild
to rebuild the native modules. - Checking whether the
lepus.node
file exists in the specified directory, but it is missing. - Ensured I have Windows build tools installed using
npm install --global windows-build-tools
.
I am working on a Node.js project and using rspeedy for development. The project is built using a new programming language and framework, and you can find more information on the Lynx Family GitHub page: https://github/lynx-family.
When I run npm run dev
, I get the following error:
PS D:\LYNX\lynx_first_project\bakakr> npm run dev
> [email protected] dev
> rspeedy dev
Rspeedy v0.8.2 (Rsbuild v1.2.11, Rspack v1.2.3)
start Building...
error Compile error:
Failed to compile, check the errors for troubleshooting.
× Error: Cannot find module 'D:\LYNX\lynx_first_project\bakakr\node_modules\@lynx-js\tasm\build\win32\Release\lepus.node'
│ Require stack:
│ - D:\LYNX\lynx_first_project\bakakr\node_modules\@lynx-js\tasm\index.js
│ at Module._resolveFilename (node:internal/modules/cjs/loader:1140:15)
│ at Module._load (node:internal/modules/cjs/loader:981:27)
│ at Module.require (node:internal/modules/cjs/loader:1231:19)
│ at require (node:internal/modules/helpers:177:18)
│ at encode_napi (D:\LYNX\lynx_first_project\bakakr\node_modules\@lynx-js\tasm\index.js:48:17)
│ at Object.fn (file:///D:/LYNX/lynx_first_project/bakakr/node_modules/@lynx-js/template-webpack-plugin/lib/LynxEncodePlugin
Steps I’ve tried to resolve the issue so far:
- Re-running
npm install
to ensure all dependencies are installed. - Deleting
node_modules
andpackage-lock.json
, then runningnpm install
again. - Running
npm rebuild
to rebuild the native modules. - Checking whether the
lepus.node
file exists in the specified directory, but it is missing. - Ensured I have Windows build tools installed using
npm install --global windows-build-tools
.
1 Answer
Reset to default 0Step-by-Step Guide to Fix the Issue:
Create a new Rspeedy project:
npm create rspeedy@latest
Navigate to the project directory:
cd 'project_name'
Modify the
package.json
:- Search for
"@lynx-js/react-rsbuild-plugin": "^0.9.0"
and change it to:"@lynx-js/react-rsbuild-plugin": "npm:@lynx-js/react-rsbuild-plugin-canary@^0.9.0"
- Search for
Run
npm install
:npm install
Double-check
package-lock.json
:- Open
package-lock.json
and verify that the version for@lynx-js/react-rsbuild-plugin
is resolved to@lynx-js/react-rsbuild-plugin-canary
. It should look like:"node_modules/@lynx-js/react-rsbuild-plugin": { "name": "@lynx-js/react-rsbuild-plugin-canary", "version": "0.9.0", "resolved": "https://registry.npmjs./@lynx-js/react-rsbuild-plugin-canary/-/react-rsbuild-plugin-canary-0.9.0.tgz" }
- Open
Fix the
index.js
file:- Open
node_modules\@lynx-js\tasm\index.js
, search for:let encode = encode_napi;
- Change it to:
let encode = getEncodeMode();
- Open
Thanks to Xuanyi Fu for providing the solution!
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744935571a4601999.html
评论列表(0条)