danielgindi/rollup-plugin-natives

Error: ENOENT: no such file or directory, copyfile

Closed this issue · 2 comments

I get an error when I try to use this plugin

[!] (plugin rollup-plugin-natives) Error: ENOENT: no such file or directory, copyfile 'C:\project\node_modules\oniguruma\build\Release\onig_scanner.node' -> 'dist\libs\onig_scanner.node'
Error: ENOENT: no such file or directory, copyfile 'C:\project\node_modules\oniguruma\build\Release\onig_scanner.node' -> 'dist\libs\onig_scanner.node'
    at Object.copyFileSync (fs.js:63:27)
    at Object.resolveId (C:\project\script\node_modules\rollup-plugin-natives\src\index.js:63:27)
    at C:\project\script\node_modules\rollup\dist\shared\rollup.js:63:27

The file C:\project\node_modules\oniguruma\build\Release\onig_scanner.node exists

Note that I run rollup from inside script folder for other reasons.

Changing

      copyTo: 'dist/libs',

to

      copyTo: '../dist/libs',

fixed the issue.

However, there are still problems with that. It seems it has issues finding the paths.

Maybe add a sample project that can easily demonstrate that?
We may need to add resolving files relative to the current file, but I have yet to see this happen (I also ran this from subfolders without an issue)