Skip to content
This repository has been archived by the owner on Jan 7, 2022. It is now read-only.

Can't install on windows #147

Closed
StarpTech opened this issue May 18, 2017 · 11 comments
Closed

Can't install on windows #147

StarpTech opened this issue May 18, 2017 · 11 comments

Comments

@StarpTech
Copy link

node -v v7.9.0
node-gyp -v v3.3.0

gyp ERR! node -v v7.9.0
gyp ERR! node-gyp -v v3.3.0
gyp ERR! not ok
npm WARN install:utp-native@1.5.0 utp-native@1.5.0 install: `node-gyp-build`
npm WARN install:utp-native@1.5.0 Exit status 1
npm WARN dat-example@1.0.0 No description
npm WARN dat-example@1.0.0 No repository field.
E:\Repositorys\dat-example> npm config set msvs_version 2013
E:\Repositorys\dat-example> npm install dat-node

> utp-native@1.5.0 install E:\Repositorys\dat-example\node_modules\utp-native
> node-gyp-build


E:\Repositorys\dat-example\node_modules\utp-native>if not defined npm_config_node_gyp (node "C:\Users\dustin\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  utp_internal.cpp
  utp_utils.cpp
  utp_hash.cpp
  utp_callbacks.cpp
e:\repositorys\dat-example\node_modules\utp-native\deps\libutp\utp_types.h(46): warning C4005: '_CRT_SECURE_NO_DEPRECATE' : macro redefinition (..\..\deps\libutp\utp_callbacks.cpp) [E:\Repositorys\dat-example\node_modules\utp-native\build\deps\libutp.vcxproj]
          command-line arguments :  see previous definition of '_CRT_SECURE_NO_DEPRECATE'
e:\repositorys\dat-example\node_modules\utp-native\deps\libutp\utp_types.h(46): warning C4005: '_CRT_SECURE_NO_DEPRECATE' : macro redefinition (..\..\deps\libutp\utp_hash.cpp) [E:\Repositorys\dat-example\node_modules\utp-native\build\deps\libutp.vcxproj]
          command-line arguments :  see previous definition of '_CRT_SECURE_NO_DEPRECATE'
e:\repositorys\dat-example\node_modules\utp-native\deps\libutp\utp_types.h(46): warning C4005: '_CRT_SECURE_NO_DEPRECATE' : macro redefinition (..\..\deps\libutp\utp_utils.cpp) [E:\Repositorys\dat-example\node_modules\utp-native\build\deps\libutp.vcxproj]
          command-line arguments :  see previous definition of '_CRT_SECURE_NO_DEPRECATE'
e:\repositorys\dat-example\node_modules\utp-native\deps\libutp\utp_types.h(46): warning C4005: '_CRT_SECURE_NO_DEPRECATE' : macro redefinition (..\..\deps\libutp\utp_internal.cpp) [E:\Repositorys\dat-example\node_modules\utp-native\build\deps\libutp.vcxproj]
          command-line arguments :  see previous definition of '_CRT_SECURE_NO_DEPRECATE'
..\..\deps\libutp\utp_internal.cpp(566): error C3861: 'snprintf': identifier not found [E:\Repositorys\dat-example\node_modules\utp-native\build\deps\libutp.vcxproj]
  utp_api.cpp
  utp_packedsockaddr.cpp
e:\repositorys\dat-example\node_modules\utp-native\deps\libutp\utp_types.h(46): warning C4005: '_CRT_SECURE_NO_DEPRECATE' : macro redefinition (..\..\deps\libutp\utp_api.cpp) [E:\Repositorys\dat-example\node_modules\utp-native\build\deps\libutp.vcxproj]
          command-line arguments :  see previous definition of '_CRT_SECURE_NO_DEPRECATE'
e:\repositorys\dat-example\node_modules\utp-native\deps\libutp\utp_types.h(46): warning C4005: '_CRT_SECURE_NO_DEPRECATE' : macro redefinition (..\..\deps\libutp\utp_packedsockaddr.cpp) [E:\Repositorys\dat-example\node_modules\utp-native\build\deps\libutp.vcxproj]
          command-line arguments :  see previous definition of '_CRT_SECURE_NO_DEPRECATE'
..\..\deps\libutp\utp_packedsockaddr.cpp(137): error C3861: 'snprintf': identifier not found [E:\Repositorys\dat-example\node_modules\utp-native\build\deps\libutp.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `msbuild` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\dustin\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:194:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Windows_NT 10.0.15063
gyp ERR! command "C:\\nodejs\\node.exe" "C:\\Users\\dustin\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd E:\Repositorys\dat-example\node_modules\utp-native
gyp ERR! node -v v7.9.0
gyp ERR! node-gyp -v v3.3.0
gyp ERR! not ok
npm WARN install:utp-native@1.5.0 utp-native@1.5.0 install: `node-gyp-build`
npm WARN install:utp-native@1.5.0 Exit status 1
npm WARN dat-example@1.0.0 No description
npm WARN dat-example@1.0.0 No repository field.

Would be awesome to see support on windows!

@StarpTech
Copy link
Author

Related to mafintosh/utp-native#8

@joehand
Copy link
Collaborator

joehand commented May 18, 2017

Yes, definitely!

The utp-native module isn't strictly required for anything to work, it can also use tcp. You should still be able to run + use it (but we haven't tested thoroughly on Windows). Did the installation fail or just give the nasty warn messages?

@StarpTech
Copy link
Author

StarpTech commented May 18, 2017

It just warns and npm doesnt exist the installation but I dont get the examples work.

Share

var src = path.join(__dirname, 'shared')

Dat(src, function (err, dat) {
  if (err) throw err

  var network = dat.joinNetwork()
  network.once('connection', function () {
    console.log('Connected')
  })
  var progress = dat.importFiles(src, {
    ignore: ['**/dat-node/node_modules/**']
  }, function (err) {
    if (err) throw err
    console.log('Done importing')
    console.log('Archive size:', dat.archive.content.byteLength)
  })
  progress.on('put', function (src, dest) {
    console.log('Added', dest.name)
  })

  console.log(`Sharing: ${dat.key.toString('hex')}\n`)
})

Download

var dest = path.join(__dirname, 'tmp')

Dat(dest, {key: key }, function (err, dat) {
  if (err) throw err

  var network = dat.joinNetwork()
  network.once('connection', function () {
    console.log('Connected')
  })

  dat.archive.readFile('/test.txt', function (err, content) {
    console.log(content, err) // prints test.txt file!
  })

  console.log(`Downloading: ${dat.key.toString('hex')}\n`)
})

Share:

Added C:\test.txt
Done importing
Archive size: 2

Download

Error: /test.txt could not be found

I also tried it with dat share and dat clone. The connection was there but the file could not be found.

@StarpTech
Copy link
Author

StarpTech commented May 18, 2017

@joehand I try to run dat doctor and get this

C:\Users\dustin\AppData\Roaming\npm\node_modules\dat\node_modules\discovery-swarm\index.js:415
    server.on('error', onerror)
          ^

TypeError: Cannot read property 'on' of null
    at Swarm.listen (C:\Users\dustin\AppData\Roaming\npm\node_modules\dat\node_modules\discovery-swarm\index.js:415:11)
    at runPublicPeerTest (C:\Users\dustin\AppData\Roaming\npm\node_modules\dat\node_modules\dat-doctor\index.js:86:8)
    at C:\Users\dustin\AppData\Roaming\npm\node_modules\dat\node_modules\dat-doctor\index.js:56:7
    at Array.forEach (native)
    at startPublicPeer (C:\Users\dustin\AppData\Roaming\npm\node_modules\dat\node_modules\dat-doctor\index.js:54:11)
    at C:\Users\dustin\AppData\Roaming\npm\node_modules\dat\node_modules\dat-doctor\index.js:29:5
    at GetAddrInfoReqWrap.asyncCallback [as callback] (dns.js:62:16)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:78:10)

@joehand
Copy link
Collaborator

joehand commented May 18, 2017

@joehand I try to run dat doctor and got this

Ah, thats a simpler dat-doctor/discovery swarm bug, dat doctor tries to run tcp and utp tests. But looks like we need to check if utp is available before running that test. (dat-ecosystem-archive/dat-doctor#8)

(still thinking about the rest of the issue, it should be able to connect over tcp but doesn't look like that is happening)

@StarpTech
Copy link
Author

StarpTech commented May 18, 2017

An issue from my side can be excluded I just run dat share and dat clone and couldn't see any files.

@joehand
Copy link
Collaborator

joehand commented May 18, 2017

An issue from my side can be be excluded I just run share and clone and couldn't see any files.

Can you tell if they ever connect? It's not clear from the code above if its a connection issue or something else.

You can try running with --sources to see more connection info, e.g. dat share --sources.

@StarpTech
Copy link
Author

StarpTech commented May 18, 2017

@joehand yes its connected but no files are transfered

Cloning: 1 files (2 B)

1 connection | Download 0 B/s Upload 0 B/s
Sharing dat: 1 files (2 B)

1 connection | Download 0 B/s Upload 0 B/s

Watching for file updates


[0] tcp: ::ffff:10.0.75.1:3282 32 B/s

@joehand
Copy link
Collaborator

joehand commented May 18, 2017

Great, thanks! This should give enough info to start tracking it down. I think we were having another windows issue that was similar but can't remember what repo the issue was in...

You can also try running with DEBUG=dat* dat share --sources and DEBUG=dat* dat clone <key>. But the debug statements are still minimal, so that may not provide too much help yet.

Ah, thats a simpler dat-doctor/discovery swarm bug, dat doctor tries to run tcp and utp tests. But looks like we need to check if utp is available before running that test. (dat-ecosystem-archive/dat-doctor#8)

I published a new dat-doctor that should fix this. But looks like its not a connection issue =).

@StarpTech
Copy link
Author

@joehand thanks for the fast feedback. I will wait for a fix :)

@joehand
Copy link
Collaborator

joehand commented Oct 19, 2017

We fixed the windows issue. But this may have been a separate bug (can't quite remember). Can you let us know if this is still an issue after updating dependencies?

@joehand joehand closed this as completed Oct 19, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants