-
Notifications
You must be signed in to change notification settings - Fork 258
Build Error on Ubuntu #297
Comments
I too faced the same issue on Ubuntu 16.04 abhatikar@raspberry-pi:
~/Code/iot-edge/tools
/home/abhatikar/Code/iot-edge/proxy/gateway/nodejs/lib/codec.js:61 SyntaxError: Unexpected token = |
I was tying to build on Ubuntu 16.04 yesterday and ran into a similar issue when following the hello-world sample. I eventually solved this particular issue by installing NodeJS according to this guide on TecAdmin.net. Unfortunately that didn't completely solve the build problems I was having. Now when I attempt to build, this is the output. (Pastebin link because GitHub is assuming some characters are for formatting) Now the output looks good - everything is passing, there are a few warnings, but no errors. However, when I navigate to my iot-edge directory, there is no build subdirectory present after running the build.sh script. build.sh also exits with an error code of 1, so it seems that the script knows that it's encountering an error, but it just isn't displaying any information about the error to the screen. Has anybody run into this issue? If so, do you have a fix for it? |
@naveen26246 @abhatikar @camauser What version of Node.js do you have on your Ubuntu machine? I suspect your version of Node.js doesn't support some of the ES6 features we're using in our new Node.js out-of-process modules feature, but I need to investigate. In thinking about it, I'm also realizing that this new feature should probably be OFF by default, since there's no guarantee that users will have Node.js installed. I'll work on that now... |
I reproduced this issue by installing the default Node.js and npm on Ubuntu 16.04:
This brings down Node.js v4.2.6, which doesn't support some of the Node/JavaScript features we're using in Node.js out-of-process modules, like default parameter values, Buffer.from() static method, etc. I'm going to do two things to fix this right now:
Stay tuned... |
@damonbarry According to |
@camauser It looks like there's some sort of silent error in our build script, but I'm not sure what it is. To help narrow it down, can you give me the output of |
Reopening while we investigate @camauser's issue. |
autoconf 2.69-9 Node version |
abhatikar@raspberry-pi:~/Code/iot-edge/tools$ ./build.sh --enable-nodejs-binding --enable-nodejs-remote-modules
~/Code/iot-edge/tools
/home/abhatikar/Code/iot-edge/proxy/gateway/nodejs/node_modules/bindings/bindings.js:83 Error: Module version mismatch. Expected 48, got 46. |
The build worked with nodejs v6.11.0 . Thanks @damonbarry @camauser |
@damonbarry Here is the output of the command you requested I run: Pastebin link |
@abhatikar I reproduced the issue you're seeing (you're on Pi, I'm on a Docker Ubuntu 16.04 container, but same error). Here's how I encountered it: apt-get install -y nodejs npm nodejs-legacy # installs v4.2.6
git clone https://github.com/azure/iot-edge.git
cd iot-edge
tools/build.sh --enable-nodejs-remote-modules # produces the original error for this GitHub issue
curl -sL https://deb.nodesource.com/setup_8.x | bash -
apt-get install -y nodejs # installs v8.0.0
tools/build.sh --enable-nodejs-remote-modules # produces your error, in the nanomsg binding I fixed the problem by cleaning the repo before building again:
I think your error was just some weird interaction between the old and new versions of Node.js. Specifically, the Can you trying cleaning/rebuilding the iot-edge code, as I did above? |
@camauser I'm not able to reproduce what you're seeing. Can you try our build script again, but add a |
@damonbarry Sure, here's a link to the output of the command with the -x switch: Link |
@camauser The following command in the build script:
Evaluates to this in your environment:
...which returns the value Since we care about the expression result and not the exit status of |
@damonbarry Thanks for the information and the fix - I pulled the new version of master and I'm now able to build and run the hello_world sample! Feel free to mark this issue as solved, unless anybody else is still having similar issues. |
Awesome! |
@damonbarry Thanks everything is working now on a fresh checkout and build.Please close the issue. |
Available in the 2017-08-21 release. |
I came across the following error while trying to run ./build.sh --enable-nodejs-binding:
/home/bhagawat/sdks/iot-edge/proxy/gateway/nodejs/lib/codec.js:61
function decodeMessageChannelUri(buf, offset = 0) {
^
SyntaxError: Unexpected token =
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:374:25)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object. (/home/bhagawat/sdks/iot-edge/proxy/gateway/nodejs/test/codec_test.js:10:13)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at /home/bhagawat/sdks/iot-edge/proxy/gateway/nodejs/node_modules/mocha/lib/mocha.js:230:27
at Array.forEach (native)
at Mocha.loadFiles (/home/bhagawat/sdks/iot-edge/proxy/gateway/nodejs/node_modules/mocha/lib/mocha.js:227:14)
at Mocha.run (/home/bhagawat/sdks/iot-edge/proxy/gateway/nodejs/node_modules/mocha/lib/mocha.js:495:10)
at Object. (/home/bhagawat/sdks/iot-edge/proxy/gateway/nodejs/node_modules/mocha/bin/_mocha:469:18)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Function.Module.runMain (module.js:442:10)
at startup (node.js:136:18)
at node.js:966:3
npm ERR! Test failed. See above for more details.
Any leads to address the issue?
The text was updated successfully, but these errors were encountered: