willemolding / holochain-rust-todo

Basic example using holochain-rust
31 stars 8 forks source link

windows 64 - hc test issues #6

Open ddw360 opened 5 years ago

ddw360 commented 5 years ago

Standardized on yarn as node package manager where hc package and hc test assumes npm as the package manager. So prior to running "hc test" - steps taken for work around:

No errors in steps above, then from root directory running "hc test" takes me all the way to "Running test in test/index/js" successfully. But I get the following error:

D:\Devtools\Holochain\hc test ?[1;32mPackaging?[0m files for testing to file: ".\\dist\\bundle.json" > ?[32mcargo?[0m ?[36mbuild --release --target=wasm32-unknown-unknown?[0m Finished release [optimized] target(s) in 0.73s > cargo build --release --target=wasm32-unknown-unknown Finished release [optimized] target(s) in 0.68s Created bundle file at ".\\dist\\bundle.json" Running tests in test/index.js > node test/index.js internal/modules/cjs/loader.js:718 return process.dlopen(module, path.toNamespacedPath(filename)); ^ Error: The specified module could not be found. \\?\D:\share\BitBucket\ddw-foo\holoapps\holochain-rust-todo\test\node_modules\@holochain\holochain-nodejs\bin-package\index.node at Object.Module._extensions..node (internal/modules/cjs/loader.js:718:18) at Module.load (internal/modules/cjs/loader.js:599:32) at tryModuleLoad (internal/modules/cjs/loader.js:538:12) at Function.Module._load (internal/modules/cjs/loader.js:530:3) at Module.require (internal/modules/cjs/loader.js:637:17) at require (internal/modules/cjs/helpers.js:22:18) at Object.<anonymous> (D:\share\BitBucket\ddw-foo\holoapps\holochain-rust-todo\test\node_modules\@holochain\holochain-nodejs\index.js:9:22) at Module._compile (internal/modules/cjs/loader.js:689:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10) at Module.load (internal/modules/cjs/loader.js:599:32) Error: command node test/index.js was not successful

ddw360 commented 5 years ago

Was able to get this to work. See pastebin link (https://pastebin.com/GkqTm16Q). Fix was to make sure "hc.exe" and "libzmq-v140-mt-4_*.dll" directory was in command environment path instead of using absolute reference.

Connoropolous commented 5 years ago

so this is resolved for you @ddw360 ?

delroh commented 5 years ago

I am having the same issue.

C:\Users\delroh\dev\Aprueba\hc\todo-list>hc test
Packaging files for testing to file: "C:\\Users\\delroh\\dev\\Aprueba\\hc\\todo-list\\dist\\todo-list.dna.json"
> cargo build --release --target=wasm32-unknown-unknown --target-dir=target
    Finished release [optimized] target(s) in 5.78s
> cargo build --release --target=wasm32-unknown-unknown --target-dir=target
    Finished release [optimized] target(s) in 1.17s
Created dna package file at "C:\\Users\\delroh\\dev\\Aprueba\\hc\\todo-list\\dist\\todo-list.dna.json"
Running tests in test/index.js
> node test/index.js
internal/modules/cjs/loader.js:718
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: The specified module could not be found.
\\?\C:\Users\delroh\dev\Aprueba\hc\todo-list\test\node_modules\@holochain\holochain-nodejs\bin-package\index.node
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:718:18)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (C:\Users\delroh\dev\Aprueba\hc\todo-list\test\node_modules\@holochain\holochain-nodejs\index.js:8:50)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
Error: command node test/index.js was not successful

It happens at const { Config, Scenario } = require("@holochain/holochain-nodejs"). Is there anything I can check to verify what the problem is that it cannot find the module?

Connoropolous commented 5 years ago

what is your OS, nodejs version, and version of this code that you're running?

delroh commented 5 years ago

Windows 10, 64, using windows-msvc

>node --version
v10.14.2
>hc --version
hc 0.0.6-alpha
Connoropolous commented 5 years ago

Can you try clearing the test/node_modules folder out, and then running npm install inside test directory?

Connoropolous commented 5 years ago

Then rerunning the command you were trying?

delroh commented 5 years ago

Ok I found the issue. I downloaded this project before you updated it to 0.0.6-alpha. I read your commits here and noticed the @holochain/holochain-nodejs dependency in package.json had to be updated too, so updated it to 0.4.5-alpha -> npm install -> problem solved; tests are running now (failing though). Thank you Connor!

Connoropolous commented 5 years ago

Fantastic. Good debugging

On Thu, Mar 21, 2019 at 11:22 PM delroh notifications@github.com wrote:

Ok I found the issue. I downloaded this project before you updated it to 0.0.6-alpha. I read your commits here and noticed the @holochain/holochain-nodejs dependency in package.json had to be updated too, so updated it to 0.4.5-alpha -> npm install -> problem solved; tests are running now (failing though). Thank you Connor!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/willemolding/holochain-rust-todo/issues/6#issuecomment-475480835, or mute the thread https://github.com/notifications/unsubscribe-auth/ABWAYSRMpXcqBYFPf0uen_zkVi8W8I47ks5vZExrgaJpZM4Zl8rM .

-- Connor Turland twitter: @Connoropolous http://twitter.com/Connoropolous

delroh commented 5 years ago

There does seem to be an issue with hc 0.0.6-alpha where running hc test on the root of the project without doing npm install manually in the test folder, it returns:

\006\holochain-rust-todo>hc test
Packaging files for testing to file: "C:\\Users\\delroh\\dev\\Aprueba\\hc\\006\\holochain-rust-todo\\dist\\holochain-rust-todo.dna.json"
> cargo build --release --target=wasm32-unknown-unknown
    Finished release [optimized] target(s) in 0.70s
> cargo build --release --target=wasm32-unknown-unknown
    Finished release [optimized] target(s) in 0.67s
Created dna package file at "C:\\Users\\delroh\\dev\\Aprueba\\hc\\006\\holochain-rust-todo\\dist\\holochain-rust-todo.dna.json"
Installing node_modules
> npm install --silent
Error: The system cannot find the file specified. (os error 2)

Will verify after updating to 0.0.7-alpha if the issue keeps happening and post here.

Connoropolous commented 5 years ago

Do you mean that it succeeds if you do run npm install manually, but failed if you didn't?

delroh commented 5 years ago

Yeah, let me clarify the steps:

Using:

  1. Download a fresh copy of this repository at version 0.0.6-alpha
  2. Open terminal at root of project and run hc test
  3. It will fail:
(...)\006\holochain-rust-todo>hc test
�[1;32mPackaging�[0m files for testing to file: "C:\\Users\\delroh\\dev\\Aprueba\\hc\\006\\holochain-rust-todo\\dist\\holochain-rust-todo.dna.json"
> cargo build --release --target=wasm32-unknown-unknown
    Finished release [optimized] target(s) in 0.70s
> cargo build --release --target=wasm32-unknown-unknown
    Finished release [optimized] target(s) in 0.67s
Created dna package file at "C:\\Users\\delroh\\dev\\Aprueba\\hc\\006\\holochain-rust-todo\\dist\\holochain-rust-todo.dna.json"
Installing node_modules
> npm install --silent
Error: The system cannot find the file specified. (os error 2)

Solution:

  1. Get into test folder cd test
  2. Run npm install
  3. cd .. back to root of project
  4. Run hc test
  5. It works.
sevenshadow commented 5 years ago

thanks delroh. the fix you outline (cd'ing into the test folder and running npm install) worked for me.