node.jsyarnpkgparallels

Issues installing node modules with Yarn on Parallels (Windows 10)


I needed to switch an Electron project from a native Windows 10 to a virtual Windows 10 machine on Mac OS with Parallels (Developer). The Nodejs and Yarn installation went smooth, but when I try to install / yarn the node modules of the project I get a bunch of errors which seem to be related to the directory structure of the virtual machine.

[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
[1/6] ⡀ core-js
[2/6] ⡀ core-js
[3/6] ⡀ node-sass
[4/6] ⡀ deasync
error \\mac\Home\Documents\Development\theproject\node_modules\deasync: Command failed.
Exit code: 1
Command: node ./build.js
Arguments: 
Directory: \\mac\Home\Documents\Development\theproject\node_modules\deasync
Output:
"\\mac\Home\Documents\Development\theproject\node_modules\deasync"

In addition CMD.EXE throws the error (summarized since it is in German) that UNC-Paths are not supported and that the path is set to Windows. And because of that I guess the following

node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module 'C:\Windows\build.js'
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:17:47 {

I am not sue, if both problems have the same reason, the unsupported UNC-path and how to fix this. Any help appreciated.


Solution

  • Turning off Desktop/Folder sharing in Parallels plus installing node-sass manually with yarn add --dev node-sass solved the problem.