thaliproject/Thali_CordovaPlugin

Update README with information about NVM_NODEJS_ORG_MIRROR

larryonoff opened this issue · 3 comments

@czyzm had issues today with creating Cordova app with Cordova Thali Plugin. It looks that we need updating README with information about setting NVM_NODEJS_ORG_MIRROR.

See the error details below.

jx npm install leveldown-mobile@1.1.1

leveldown-mobile@1.1.1 install /Users/mczyz/thali/test/TestClearCordova/mytest/node_modules/leveldown-mobile "/usr/local/bin/jx" /Users/mczyz/.jx/npm/node_modules/node-gyp/bin/node-gyp.js rebuild

gyp JXcore NODE-GYP Using node-gyp bundled in npm coming from JXcore
gyp ERR! UNCAUGHT EXCEPTION 
gyp ERR! stack TypeError: Arguments to path.resolve must be strings
gyp ERR! stack     at Object.exports.resolve (path.js:296:15)
gyp ERR! stack     at install (/Users/mczyz/.jx/npm/node_modules/node-gyp/lib/install.js:73:21)
gyp ERR! stack     at Object.self.commands.(anonymous function) [as install] (/Users/mczyz/.jx/npm/node_modules/node-gyp/lib/node-gyp.js:66:37)
gyp ERR! stack     at getNodeDir (/Users/mczyz/.jx/npm/node_modules/node-gyp/lib/configure.js:155:20)
gyp ERR! stack     at /Users/mczyz/.jx/npm/node_modules/node-gyp/lib/configure.js:108:9
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:663:7)
gyp ERR! stack     at ChildProcess.emit (events.js:85:17)
gyp ERR! stack     at maybeClose (child_process.js:773:16)
gyp ERR! stack     at Socket.<anonymous> (child_process.js:994:11)
gyp ERR! stack     at Socket.emit (events.js:82:17)
gyp ERR! System Darwin 15.6.0
gyp ERR! command "/usr/local/bin/jx" "/Users/mczyz/.jx/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/mczyz/thali/test/TestClearCordova/mytest/node_modules/leveldown-mobile
gyp ERR! node -v v0.10.40
gyp ERR! node-gyp -v v3.0.3
gyp ERR! This is a bug in `node-gyp`.
gyp ERR! Try to update node-gyp and file an Issue if it does not help:
gyp ERR!     <https://github.com/nodejs/node-gyp/issues>
npm WARN EPACKAGEJSON mytest@1.0.0 No description
npm WARN EPACKAGEJSON mytest@1.0.0 No repository field.
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/jx" "/Users/mczyz/.jx/npm/bin/npm-cli.js" "--loglevel" "http" "--color" "true" "install" "leveldown-mobile@1.1.1"
npm ERR! node v0.10.40
npm ERR! npm  v3.3.12
npm ERR! code ELIFECYCLE

npm install leveldown-mobile@1.1.1

gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp: name 'node_win_onecore' is not defined while evaluating condition 'node_win_onecore==1' in /Users/mczyz/thali/test/TestClearCordova/mytest/node_modules/leveldown-mobile/deps/leveldb/leveldb.gyp while loading dependencies of binding.gyp while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/Users/mczyz/.nvm/versions/node/v6.6.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:305:16)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Darwin 15.6.0
gyp ERR! command "/Users/mczyz/.nvm/versions/node/v6.6.0/bin/node" "/Users/mczyz/.nvm/versions/node/v6.6.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/mczyz/thali/test/TestClearCordova/mytest/node_modules/leveldown-mobile
gyp ERR! node -v v6.6.0
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok 
npm WARN mytest@1.0.0 No description
npm WARN mytest@1.0.0 No repository field.
npm ERR! Darwin 15.6.0
npm ERR! argv "/Users/mczyz/.nvm/versions/node/v6.6.0/bin/node" "/Users/mczyz/.nvm/versions/node/v6.6.0/bin/npm" "install" "leveldown-mobile@1.1.1"
npm ERR! node v6.6.0
npm ERR! npm  v3.10.3
npm ERR! code ELIFECYCLE

Right now the setUpDesktop.sh script automatically sets both this and the JX_NPM_JXB variables. And I confirmed on my own desktop that these variables are not normally set but I can build just fine.

Do you know if @czyzm ran setupTests.sh without first running setupDesktop.sh? As explained in #1221 that doesn't work.

czyzm commented

I was not aware of that issue. I was running setupTest.sh alone with jx npm run setupUnit (just following instruction in https://github.com/thaliproject/Thali_CordovaPlugin/tree/master/test for running mobile tests.

@yaronyg should we add into Mobile section the following?

You need setting up your desktop environment for development. Go to Thali_CordovaPlugin/thali/install and run `jx npm run setupDesktop`

It would be even much better adding link about issue #1221 in README