Skip to content
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

Error: cannot find module '../native' #428

Closed
digital-nomad17 opened this issue Aug 28, 2019 · 5 comments
Closed

Error: cannot find module '../native' #428

digital-nomad17 opened this issue Aug 28, 2019 · 5 comments

Comments

@digital-nomad17
Copy link

Working through the tutorial code and I run into this error

> var threadCount = require('.')
Thrown:
{ Error: Cannot find module '../native'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18) code: 'MODULE_NOT_FOUND' }

Maybe there's something wrong with my configuration:

OS: Windows 10
Rust ver:1.37.0
neon: 0.31
ide:clion with rust plugin

@kjvalencik
Copy link
Member

This seems like either the neon build wasn't ran or failed.

Does your package.json have an install step to run neon build? If you run neon build manually, do you get any errors?

@digital-nomad17
Copy link
Author

I get this error when I run neon build

error: Neon only builds with --release. For tests, try `cargo test --release`.
   --> C:\Users\Andrew\.cargo\registry\src\github.com-1ecc6299db9ec823\neon-0.3.1\src\lib.rs:292:1
    |
292 | compile_error!("Neon only builds with --release. For tests, try `cargo test --release`.");
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

error: Could not compile `neon`.

To learn more, run the command again with --verbose.
neon ERR! cargo build failed

Error: cargo build failed
    at Target.<anonymous> (F:\Code\rust\neon_demo\thread-count\node_modules\neon-cli\lib\target.js:124:35)
    at step (F:\Code\rust\neon_demo\thread-count\node_modules\neon-cli\lib\target.js:32:23)
    at Object.next (F:\Code\rust\neon_demo\thread-count\node_modules\neon-cli\lib\target.js:13:53)
    at fulfilled (F:\Code\rust\neon_demo\thread-count\node_modules\neon-cli\lib\target.js:4:58)
    at process._tickCallback (internal/process/next_tick.js:68:7)

Here's my package.json:

{
  "name": "thread-count",
  "version": "0.1.0",
  "description": "demo",
  "main": "lib/index.js",
  "author": "",
  "license": "MIT",
  "dependencies": {
    "neon-cli": "^0.3.1"
  },
  "scripts": {
    "install": "neon build"
  }
}

@adumbidiot
Copy link
Contributor

adumbidiot commented Oct 8, 2019

Try running neon build --release

@usagi
Copy link
Contributor

usagi commented Mar 24, 2020

I have an interested to this issue related from #463 . But, I think this situation could be solved with @adumbidiot 's proposal nor you @digital-nomad17 was solved the problem but you forgetting to close this issue. 😄 Would you close it or please share an additional infos?


Related: #463 "No way to build without --release?"

@kjvalencik
Copy link
Member

Closing as a duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants