-
Notifications
You must be signed in to change notification settings - Fork 597
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
building native module in windows subsystem for linux #163
Comments
@srikanthkampati I'm not sure this is the right repository for your question. I'm thinking it should be in the help repo instead. Do you mind if I move it there as its more like to get some visibility there. |
To enable WSL (Windows Subsystem for Linux) to compile and build native Windows modules with npm install, you'll need to configure your environment to handle the cross-compilation. The error you're encountering with 'gyp' failing at NodeGyp.rebuildModule typically indicates issues with building native addons, which are often C++ modules that need to be compiled for the target platform. Here are the steps you can take to configure your WSL environment: Install Windows Build Tools: Install Node.js on Windows: Ensure that Node.js is installed on your Windows environment. This is because the native modules you are trying to compile are for Windows, not Linux. Configure npm to use Windows Node.js from WSL:
Replace Typically, it would be in Program Files. Make sure you can access the Windows file system from WSL. You should be able to navigate to your Windows file system using Run npm Install: |
below is the error i am getting when i am trying to build a native .node file in WSL.
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp info find Python using Python version 3.6.7 found at "/usr/bin/python3"
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: ENOENT: no such file or directory, mkdir '/root/.cache/node-gyp/8.10.0'
gyp ERR! System Linux 4.4.0-17763-Microsoft
gyp ERR! command "/usr/bin/node" "/usr/local/bin/node-gyp" "rebuild"
gyp ERR! cwd /mnt/d/workspace/NAS_EDIE/Tool_Libraries/node-examples/1_hello_world
gyp ERR! node -v v8.10.0
gyp ERR! node-gyp -v v7.1.2
gyp ERR! not ok
The text was updated successfully, but these errors were encountered: