Skip to content
Luna
Esc
↑↓navigate↵open⌘Jpreview
On this page

is a native addon, which Luna can't deploy

A deploy stopped because a dependency ships compiled .node code, and lunas run only JavaScript and WebAssembly.

Some npm packages include compiled machine code as a .node file. A luna runs only JavaScript and WebAssembly, so a deploy refuses such a package before it uploads anything.

Issue

luna deploy stops with this message, naming the file it found. luna dev shows the same message.

error: <PATH_TO_FILE>.node is a native addon, which Luna can't deploy: only JavaScript and WebAssembly run in a luna

Cause

A deploy sends your app’s dependencies as they are installed in node_modules, and the packages they depend on in turn. It refuses the first package that holds a .node file.

Some packages need no change from you:

  • A package listed in devDependencies stays behind, so its addon never counts.
  • A package listed in optionalDependencies or peerDependencies is left out when it holds an addon, whether your app or another package lists it.

The addon stops the deploy when the package is a plain dependency, of your app or of a package your app uses.

Solution

Replace the package with one written in JavaScript or built to WebAssembly. First find which of your dependencies pulls it in.

npm ls <PACKAGE>

Swap that dependency for a JavaScript or WebAssembly one, or drop it. If only your build or your tests need it, move it to devDependencies. Then deploy again.

For work that needs native code, run it in a sandbox, as Run a sandbox shows.

Was this page helpful?