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

Browserize.sh Error #74

Closed
menja12 opened this issue Jul 15, 2016 · 29 comments
Closed

Browserize.sh Error #74

menja12 opened this issue Jul 15, 2016 · 29 comments

Comments

@menja12
Copy link

menja12 commented Jul 15, 2016

It seems as though browserize is looking for a file in the mqtt node module, in the browser sub directory, but it isn't finding it.

I've tried running the script on windows, and Raspbian linux OS.

@chaurah
Copy link

chaurah commented Jul 15, 2016

Hi menja12,
Can you copy the error that you are seeing on Windows and Raspbian and paste it in a comment? That would be really helpful in analyzing the issue. Thank you.

Rahul

@menja12
Copy link
Author

menja12 commented Jul 16, 2016

I’m attempting to create a browser sdk js file to import to my Angular 2 project. I’m not sure if I can use systemJS to load the aws iot sdk without browserizing.
Windows:
• Node -v 4.4.5
• Npm -v 2.15.5
• Browserify –version 13.0.1
• I download aws-iot-device-sdk and ran an npm install in the top directory.
I tried npm run-script browserize and it fails with:

0 info it worked if it ends with ok

1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'run-script',
1 verbose cli 'browserize' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prebrowserize', 'browserize', 'postbrowserize' ]
5 info prebrowserize [email protected]
6 info browserize [email protected]
7 verbose unsafe-perm in lifecycle true
8 info [email protected] Failed to exec browserize script
9 verbose stack Error: [email protected] browserize: ./scripts/browserize.sh
9 verbose stack Exit status 1
9 verbose stack at EventEmitter. (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:217:16)
9 verbose stack at emitTwo (events.js:87:13)
9 verbose stack at EventEmitter.emit (events.js:172:7)
9 verbose stack at ChildProcess. (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:24:14)
9 verbose stack at emitTwo (events.js:87:13)
9 verbose stack at ChildProcess.emit (events.js:172:7)
9 verbose stack at maybeClose (internal/child_process.js:827:16)
9 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
10 verbose pkgid [email protected]
11 verbose cwd C:\angular2\awsiotsdk\node_modules\aws-iot-device-sdk
12 error Windows_NT 10.0.10586
13 error argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "run-script" "browserize"
14 error node v4.4.5
15 error npm v2.15.5
16 error code ELIFECYCLE
17 error [email protected] browserize: ./scripts/browserize.sh
17 error Exit status 1
18 error Failed at the [email protected] browserize script './scripts/browserize.sh'.
18 error This is most likely a problem with the aws-iot-device-sdk package,
18 error not with npm itself.
18 error Tell the author that this fails on your system:
18 error ./scripts/browserize.sh
18 error You can get information on how to open an issue for this project with:
18 error npm bugs aws-iot-device-sdk
18 error Or if that isn't available, you can get their info via:
18 error
18 error npm owner ls aws-iot-device-sdk
18 error There is likely additional logging output above.
19 verbose exit [ 1, true ]

I assumed this might be because the shell script might have been designed for linux.
So I try running on Raspbian Jesse with
• node -v 0.10.29
• npm -v 2.15.9
• browserize version 13.0.1
I run sudo npm run-script browserize

0 info it worked if it ends with ok

1 verbose cli [ 'node', '/usr/local/bin/npm', 'run-script', 'browserize' ]
2 info using [email protected]
3 info using [email protected]
4 verbose node symlink /usr/bin/node
5 verbose run-script [ 'prebrowserize', 'browserize', 'postbrowserize' ]
6 info prebrowserize [email protected]
7 info browserize [email protected]
8 verbose unsafe-perm in lifecycle true
9 info [email protected] Failed to exec browserize script
10 verbose stack Error: [email protected] browserize: ./scripts/browserize.sh
10 verbose stack Exit status 3
10 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:217:16)
10 verbose stack at EventEmitter.emit (events.js:98:17)
10 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14)
10 verbose stack at ChildProcess.emit (events.js:98:17)
10 verbose stack at maybeClose (child_process.js:755:16)
10 verbose stack at Process.ChildProcess._handle.onexit (child_process.js:822:5)
11 verbose pkgid [email protected]
12 verbose cwd /home/pi/Desktop/New/node_modules/aws-iot-device-sdk
13 error Linux 4.4.11-v7+
14 error argv "node" "/usr/local/bin/npm" "run-script" "browserize"
15 error node v0.10.29
16 error npm v2.15.9
17 error code ELIFECYCLE
18 error [email protected] browserize: ./scripts/browserize.sh
18 error Exit status 3
19 error Failed at the [email protected] browserize script './scripts/browserize.sh'.
19 error This is most likely a problem with the aws-iot-device-sdk package,
19 error not with npm itself.
19 error Tell the author that this fails on your system:
19 error ./scripts/browserize.sh
19 error You can get information on how to open an issue for this project with:
19 error npm bugs aws-iot-device-sdk
19 error Or if that isn't available, you can get their info via:
19 error
19 error npm owner ls aws-iot-device-sdk
19 error There is likely additional logging output above.
20 verbose exit [ 1, true ]

I’ve also tried running the browserify commands manually following the comments of the script, but I get stuck at the compression stage, where I’m not exactly sure which files get copied where. So I couldn’t patch the mqtt file because it didn’t exist in my browser directory. I tried manually npm installing from the browser directory, but the package.json doesn’t require mqtt, so I also tried manually copying all the modules from the modules folder but couldn’t get a working browser sdk bundle js file.

Any help is greatly appreciated :)

@gkwicker
Copy link
Contributor

Hi @menja12, the problem you're seeing is probably this one. The browserize.sh script requires npm version 3; upgrading your npm installation should fix the issue. Thanks for using AWS IoT.

@menja12
Copy link
Author

menja12 commented Jul 17, 2016

I've updated, and ran the script but still giving me an error.

0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'run-script',
1 verbose cli 'browserize' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prebrowserize', 'browserize', 'postbrowserize' ]
5 info lifecycle [email protected]prebrowserize: [email protected]
6 silly lifecycle [email protected]
prebrowserize: no script for prebrowserize, continuing
7 info lifecycle [email protected]browserize: [email protected]
8 verbose lifecycle [email protected]
browserize: unsafe-perm in lifecycle true
9 verbose lifecycle [email protected]browserize: PATH: C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin;C:\angular2\awsiotsdk\node_modules\aws-iot-device-sdk\node_modules.bin;C:\angular2\awsiotsdk\node_modules.bin;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\QuickTime\QTSystem;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Program Files\Hewlett-Packard\SimplePass;C:\Program Files\MATLAB\R2015b\runtime\win64;C:\Program Files\MATLAB\R2015b\bin;C:\Program Files (x86)\Skype\Phone;C:\Program Files (x86)\Brackets\command;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Android\sdk\platform-tools;C:\Android\sdk\tools;C:\Program Files\nodejs;C:\Users\New user\AppData\Local.meteor;C:\Program Files (x86)\Microsoft VS Code\bin;C:\Program Files (x86)\WinAnt\bin;C:\Users\New user\AppData\Roaming\npm
10 verbose lifecycle [email protected]
browserize: CWD: C:\angular2\awsiotsdk\node_modules\aws-iot-device-sdk
11 silly lifecycle [email protected]browserize: Args: [ '/d /s /c', './scripts/browserize.sh' ]
12 silly lifecycle [email protected]
browserize: Returned: code: 1 signal: null
13 info lifecycle [email protected]~browserize: Failed to exec browserize script
14 verbose stack Error: [email protected] browserize: ./scripts/browserize.sh
14 verbose stack Exit status 1
14 verbose stack at EventEmitter. (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:233:16)
14 verbose stack at emitTwo (events.js:87:13)
14 verbose stack at EventEmitter.emit (events.js:172:7)
14 verbose stack at ChildProcess. (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:24:14)
14 verbose stack at emitTwo (events.js:87:13)
14 verbose stack at ChildProcess.emit (events.js:172:7)
14 verbose stack at maybeClose (internal/child_process.js:818:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
15 verbose pkgid [email protected]
16 verbose cwd C:\angular2\awsiotsdk\node_modules\aws-iot-device-sdk
17 error Windows_NT 10.0.10586
18 error argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "run-script" "browserize"
19 error node v5.0.0
20 error npm v3.3.6
21 error code ELIFECYCLE
22 error [email protected] browserize: ./scripts/browserize.sh
22 error Exit status 1
23 error Failed at the [email protected] browserize script './scripts/browserize.sh'.
23 error This is most likely a problem with the aws-iot-device-sdk package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error ./scripts/browserize.sh
23 error You can get their info via:
23 error npm owner ls aws-iot-device-sdk
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

@chaurah
Copy link

chaurah commented Jul 17, 2016

Hi @menja12,
I see you're running this on Windows. The run-script command tries to run a shell script which will not work without a bash terminal installed in Windows. You should be able to get it working on your Raspberry Pi after you upgrade the npm version. But to get it running on Windows you will need to install something like Cygwin which can run a shell script.
I apologize for the inconvenience. We will look at modifying this in a future release to enable execution of this command from a windows terminal as well. Please let us know if you have any further issues.

Rahul

@menja12
Copy link
Author

menja12 commented Jul 17, 2016

Makes sense. I'll give Cygwin a shot.
Are any of the browserize.sh commands linux specific? or can a batch file be created with the same effect?

@Krieke
Copy link

Krieke commented Jul 20, 2016

I having also issue with the browserize.sh script:
Ubuntu 16.04
Node version: v4.47
Npm version : v.3.10.5

Procedure:
/>npm install aws-iot-device-sdk
Note : since the documentation mentioned that it would also create a separate browser bundle for the aws-sdk I also installed the " npm install aws-sdk"
cd node_modules/aws-iot-device-sdk
npm run-script npm run-script

After the script execution I had the following output: <note: although this errors I found a
aws-iot-sdk-browser-bundle.js, but didn't find any for the "aws-sdk". Not even sure if my bundle is complete.


npm WARN [email protected] No description
npm WARN [email protected] No repository field.
browserize.sh: prepared browser bundle
browserize.sh: can't browserify () because it's not a file

npm ERR! Linux 4.4.0-28-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run-script" "browserize"
npm ERR! node v4.4.7
npm ERR! npm v3.10.5
npm ERR! code ELIFECYCLE
npm ERR! [email protected] browserize: ./scripts/browserize.sh
npm ERR! Exit status 3
npm ERR!
npm ERR! Failed at the [email protected] browserize script './scripts/browserize.sh'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the aws-iot-device-sdk package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ./scripts/browserize.sh
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs aws-iot-device-sdk
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls aws-iot-device-sdk
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?


output of npm-debug.log

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/nodejs', '/usr/bin/npm', 'run-script', 'browserize' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prebrowserize', 'browserize', 'postbrowserize' ]
5 info lifecycle [email protected]prebrowserize: [email protected]
6 silly lifecycle [email protected]
prebrowserize: no script for prebrowserize, continuing
7 info lifecycle [email protected]browserize: [email protected]
8 verbose lifecycle [email protected]
browserize: unsafe-perm in lifecycle true
9 verbose lifecycle [email protected]browserize: PATH: /usr/lib/node_modules/npm/bin/node-gyp-bin:/home/krieke/development/klarrio/cordova/awsgeopub/node_modules/aws-iot-device-sdk/node_modules/.bin:/home/krieke/development/klarrio/cordova/awsgeopub/node_modules/.bin:/usr/bin:/home/krieke/development/klarrio/cordova/awsgeopub/node_modules/.bin:/home/krieke/Android/Sdk/platform-tools:/home/krieke/Android/Sdk/tools:/opt/android-studio/bin:/usr/lib/jvm/java-8-openjdk-amd64/bin:/opt/scala-2.11.8/bin:/opt/idea-IC-145.1617.8/bin:/home/krieke/development/klarrio/cordova/cipalpoc/node_modules/.bin:/home/krieke/Android/Sdk/platform-tools:/home/krieke/Android/Sdk/tools:/opt/android-studio/bin:/usr/lib/jvm/java-8-openjdk-amd64/bin:/opt/scala-2.11.8/bin:/opt/idea-IC-145.1617.8/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
10 verbose lifecycle [email protected]
browserize: CWD: /home/krieke/development/klarrio/cordova/awsgeopub/node_modules/aws-iot-device-sdk
11 silly lifecycle [email protected]browserize: Args: [ '-c', './scripts/browserize.sh' ]
12 silly lifecycle [email protected]
browserize: Returned: code: 3 signal: null
13 info lifecycle [email protected]~browserize: Failed to exec browserize script
14 verbose stack Error: [email protected] browserize: ./scripts/browserize.sh
14 verbose stack Exit status 3
14 verbose stack at EventEmitter. (/usr/lib/node_modules/npm/lib/utils/lifecycle.js:242:16)
14 verbose stack at emitTwo (events.js:87:13)
14 verbose stack at EventEmitter.emit (events.js:172:7)
14 verbose stack at ChildProcess. (/usr/lib/node_modules/npm/lib/utils/spawn.js:40:14)
14 verbose stack at emitTwo (events.js:87:13)
14 verbose stack at ChildProcess.emit (events.js:172:7)
14 verbose stack at maybeClose (internal/child_process.js:827:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
15 verbose pkgid [email protected]
16 verbose cwd /home/krieke/development/klarrio/cordova/awsgeopub/node_modules/aws-iot-device-sdk
17 error Linux 4.4.0-28-generic
18 error argv "/usr/bin/nodejs" "/usr/bin/npm" "run-script" "browserize"
19 error node v4.4.7
20 error npm v3.10.5
21 error code ELIFECYCLE
22 error [email protected] browserize: ./scripts/browserize.sh
22 error Exit status 3
23 error Failed at the [email protected] browserize script './scripts/browserize.sh'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the aws-iot-device-sdk package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error ./scripts/browserize.sh
23 error You can get information on how to open an issue for this project with:
23 error npm bugs aws-iot-device-sdk
23 error Or if that isn't available, you can get their info via:
23 error npm owner ls aws-iot-device-sdk
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

@menja12
Copy link
Author

menja12 commented Jul 20, 2016

I wan't sure which packages were required when installing Cygwin, so I installed virtualBox and ubuntu. I got the "can't browserify () because it's not a file" error too. When I tried browserize on the temperature monitor example though, it works. It appears that both AWS-SDK and AWS-IOT-SDK get included in the bundle. Also I ran npm install in the top directory and the browser directory. Not sure if that made any difference.

@Krieke
Copy link

Krieke commented Jul 20, 2016

@menja12 : just to make sure that I understand your reply: 1) you got it only working with the example code? 2) you had it also working with only the aws-iot-device-sdk installed which created a bundle containing also aws-sdk package? 3) You only succeeded with option (2) while running the "npm run-script ...." from the aws-iot-device-sdk directory and aws-iot-device-sdk/browser directory?

@menja12
Copy link
Author

menja12 commented Jul 20, 2016

  1. Yes - still working loading it into my angular project.
  2. Yes - this appears to be the case unless temperature example doesn't require aws-sdk at all
  3. The browserised example works, but I can't get the bundled js with plain browserize to work.

@menja12
Copy link
Author

menja12 commented Jul 20, 2016

Using: https://sdk.amazonaws.com/builder/js/
I built a package of the AWS-SDK with the basic iot services. I got this loaded into my project and was able to connect to Iot and make https requests.

The iot-sdk optimisation documentation says it's possible to use custom packages with just the services you require and that the browserize.sh helper doesn't handle it. Maybe a custom browserify running is the answer for me... Will let you know if I work anything out

@Krieke
Copy link

Krieke commented Jul 20, 2016

Indeed... I did this first also, but I am building a prototype with
cordova... so a quick project on which I would like to use mqtts to a
broker. Not HTTPS or websockets...I just checked my bundle.js and it seems
to contain everything that I require unless the error that I got. Maybe up
to the AWS guys to fix ;-)

Daniel Vangrieken

Email : [email protected]
Phone: +32 (0) 476 / 99 65 61

2016-07-20 3:00 GMT+02:00 menja12 [email protected]:

Using: https://sdk.amazonaws.com/builder/js/
I built a package of the AWS-SDK with the basic iot services. I got this
loaded into my project and was able to connect to Iot and make https
requests.

The iot-sdk optimisation documentation says it's possible to use custom
packages with just the services you require and that the browserize.sh
helper doesn't handle it. Maybe a custom browserify running is the answer
for me... Will let you know if I work anything out


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#74 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AS4X3rDfNSD30Q6J8rEuduM4GTu6_2zHks5qXXM7gaJpZM4JNFbA
.

@Krieke
Copy link

Krieke commented Jul 20, 2016

@menja12 I can confirm that the bundle created with a successful run : npm run-script browserize examples/browser/temperature-monitor/index.js has the same size as the bundle that I created when encountering issues. So for me this is just a confirmation that my bundle should indeed contains everything that I require.

@electronut
Copy link

Hi @menja12 - I am running into the same issue on Windows. Could you tell me what packages you included in AWS builder to get AWS IoT working? Thanks.

@menja12
Copy link
Author

menja12 commented Jul 20, 2016

I included iot, and iotdata. in the aws builder. But the AWS builder iot service is limited to either a post or a get. The aws iot device sdk is a more complete solution because you can subscribe and get updates live. I still haven't got that working yet.

@electronut
Copy link

electronut commented Jul 20, 2016

Thanks @menja12 . Can someone at Amazon suggest a fix? @gkwicker using npm 3 doesn't seem to fix the problem as previously mentioned - @menja12 has tried it above.

I'd appreciate any suggestions as I am unable to get this working. Thanks.

@menja12
Copy link
Author

menja12 commented Jul 20, 2016

Besides npm3, you must also be running linux. the browserize.sh file is the linux version of a browserize.bat so it must be run using a linux machine or cygwin which is a linux emulator for windows

@electronut
Copy link

I used it with the git bash shell in Windows.

@menja12
Copy link
Author

menja12 commented Jul 27, 2016

I successfully loaded the bundle into Angular 2! Because it isn't an es6 module, it needed to be treated differently. I added some code to system js config, and a typescript definition and imported into a service typescript file.

@ssantosh21
Copy link

ssantosh21 commented Aug 20, 2016

Hi everyone,
Just wondering, is there any fix for this issue, someone has done. Because I am running with the same issue.
`
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
browserize.sh: prepared browser bundle
browserize.sh: can't browserify () because it's not a file

npm ERR! Linux 3.10.0-327.el7.x86_64
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run-script" "browserize"
npm ERR! node v4.5.0
npm ERR! npm v3.10.6
npm ERR! code ELIFECYCLE
npm ERR! [email protected] browserize: ./scripts/browserize.sh
npm ERR! Exit status 3
npm ERR!
npm ERR! Failed at the [email protected] browserize script './scripts/browserize.sh'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the aws-iot-device-sdk package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ./scripts/browserize.sh
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs aws-iot-device-sdk
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls aws-iot-device-sdk
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /tmp/aws-iot-device-sdk-js-master/npm-debug.log
[root@ip-172-31-25-233 aws-iot-device-sdk-js-master]#

Thanks,
`

@menja12
Copy link
Author

menja12 commented Aug 20, 2016

Try latest npm and node version. (You must download manually 5.0 beta)

@ssantosh21
Copy link

Hi menja12,
I installed nodejs 5.x npm 3.x but I am still getting the same error. Here are the steps which I performed:

  1. installed nodejs from RPM
  2. installed aws-sdk and browserify through npm
  3. downloaded the aws-iot-device-sdk-js
  4. inside the directory ' aws-iot-device-sdk-js' executed the command 'npm run-script browserize'

node version: v5.9.0
npm version: 3.7.3

it will be great if can guide me, or can you please share your browserified version of the file?

Thanks,

@menja12
Copy link
Author

menja12 commented Aug 20, 2016

Try npm install in the root dir. If it doesn't work lll send you my version of file. But that solution isn't updatable

@ssantosh21
Copy link

Hello @menja12,
I am not sure whether I am doing it right. Here are the steps which I am doing request you to please verify:

  1. OS - RHEL
  2. Installed NodeJS 5.9 (through RPM)
  3. npm updated to 3.x version, and installed browserify
  4. npm install aws-sdk
  5. downloaded the zip 'aws-iot-device-sdk-js' from github
  6. extract it in /tmp directory
  7. cd /tmp/aws-iot..
  8. npm install
  9. npm run-script browserize

Please can you check if I am doing right?
thanks,

@mendeljacks
Copy link

Change to ....browser-bundle.js

aws-iot-sdk-browser-bundleDOTjs.txt

@gkwicker
Copy link
Contributor

Hi @ssantosh21, the browserize script expects an application as an argument. Can you try the following?

git clone https://github.com/aws/aws-iot-device-sdk-js.git
cd aws-iot-device-sdk-js/
npm install
npm run-script browserize examples/browser/lifecycle/index.js

After you've run this once, the browser bundle will be located in browser/aws-iot-sdk-browser-bundle.js. Let us know if that takes care of the problem, and thanks for using AWS IoT.

@dilipsarkar
Copy link

Hi @gkwicker, I have tried your above mentioned steps but its still giving similar error. I'm running it on Windows PC using cygwin. Any help would be appreciated, please find the error logs below -

0 info it worked if it ends with ok
1 verbose cli [ 'C:\PROGRAM FILES\NODEJS\node.exe',
1 verbose cli 'C:\Users\dilip.sarkar\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'run-script',
1 verbose cli 'browserize',
1 verbose cli 'examples/browser/lifecycle/index.js' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prebrowserize', 'browserize', 'postbrowserize' ]
5 info lifecycle [email protected]prebrowserize: [email protected]
6 silly lifecycle [email protected]
prebrowserize: no script for prebrowserize, continuing
7 info lifecycle [email protected]browserize: [email protected]
8 verbose lifecycle [email protected]
browserize: unsafe-perm in lifecycle true
9 verbose lifecycle [email protected]browserize: PATH: C:\Users\dilip.sarkar\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin;C:\wamp\www\aws_iot_test\aws-iot-device-sdk-js-master\node_modules.bin;C:\cygwin64\usr\local\bin;C:\cygwin64\bin;C:\PROGRAMDATA\ORACLE\JAVA\JAVAPATH;C:\PYTHON27;C:\PYTHON27\SCRIPTS;C:\windows\SYSTEM32;C:\windows;C:\windows\SYSTEM32\WBEM;C:\windows\SYSTEM32\WINDOWSPOWERSHELL\V1.0;C:\PROGRAM FILES (X86)\OPENSSH\BIN;C:\PROGRAM FILES\TORTOISEGIT\BIN;C:\PROGRAM FILES\NODEJS;C:\Program Files (x86)\Lua\5.1;C:\Program Files (x86)\Lua\5.1\clibs;C:\Users\dilip.sarkar\AppData\Roaming\Python\Scripts;C:\Users\dilip.sarkar\AppData\Roaming\npm;C:\Users\dilip.sarkar\AppData\Local\Android\sdk1\platform-tools;C:\Users\dilip.sarkar\AppData\Local\Android\sdk1\build-tools
10 verbose lifecycle [email protected]
browserize: CWD: C:\wamp\www\aws_iot_test\aws-iot-device-sdk-js-master
11 silly lifecycle [email protected]browserize: Args: [ '/d /s /c',
11 silly lifecycle './scripts/browserize.sh "examples/browser/lifecycle/index.js"' ]
12 silly lifecycle [email protected]
browserize: Returned: code: 1 signal: null
13 info lifecycle [email protected]~browserize: Failed to exec browserize script
14 verbose stack Error: [email protected] browserize: ./scripts/browserize.sh "examples/browser/lifecycle/index.js"
14 verbose stack Exit status 1
14 verbose stack at EventEmitter. (C:\Users\dilip.sarkar\AppData\Roaming\npm\node_modules\npm\lib\utils\lifecycle.js:279:16)
14 verbose stack at emitTwo (events.js:87:13)
14 verbose stack at EventEmitter.emit (events.js:172:7)
14 verbose stack at ChildProcess. (C:\Users\dilip.sarkar\AppData\Roaming\npm\node_modules\npm\lib\utils\spawn.js:40:14)
14 verbose stack at emitTwo (events.js:87:13)
14 verbose stack at ChildProcess.emit (events.js:172:7)
14 verbose stack at maybeClose (internal/child_process.js:818:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
15 verbose pkgid [email protected]
16 verbose cwd C:\wamp\www\aws_iot_test\aws-iot-device-sdk-js-master
17 error Windows_NT 6.1.7601
18 error argv "C:\PROGRAM FILES\NODEJS\node.exe" "C:\Users\dilip.sarkar\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "run-script" "browserize" "examples/browser/lifecycle/index.js"
19 error node v4.1.2
20 error npm v4.0.3
21 error code ELIFECYCLE
22 error [email protected] browserize: ./scripts/browserize.sh "examples/browser/lifecycle/index.js"
22 error Exit status 1
23 error Failed at the [email protected] browserize script './scripts/browserize.sh "examples/browser/lifecycle/index.js"'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the aws-iot-device-sdk package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error ./scripts/browserize.sh "examples/browser/lifecycle/index.js"
23 error You can get information on how to open an issue for this project with:
23 error npm bugs aws-iot-device-sdk
23 error Or if that isn't available, you can get their info via:
23 error npm owner ls aws-iot-device-sdk
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

@fengsongAWS
Copy link
Contributor

CMD script provided in v2.0.0

@c4adarsh
Copy link

c4adarsh commented Jul 14, 2017

@menja12 @gkwicker : It would be a great help if you can guide me in integrating the browserified aws-iot-sdk-browser-bundle.js file into angular2 project. I have browserified aws-iot-device-sdk-js, but I have no idea of making changes to Systemjs file in angular2 and importing it to the transcript files.

Thanks in Advance.

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

9 participants