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

Cannot npm install webmonkeys #2

Closed
goldenratio opened this issue Aug 25, 2016 · 8 comments
Closed

Cannot npm install webmonkeys #2

goldenratio opened this issue Aug 25, 2016 · 8 comments

Comments

@goldenratio
Copy link

C:\Projects\webmonkeys>npm install webmonkeys
|
> gl@4.0.2 install C:\Projects\webmonkeys\node_modules\webmonkeys\node_modules\g
l
> prebuild --install

prebuild WARN install error: 126\\?\C:\Projects\webmonkeys\node_modules\webmonke
ys\node_modules\gl\build\Release\webgl.node
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe".
 To fix this, 1) install the .NET Framework 2.0 SDK, 2) install Microsoft Visua
l Studio 2005 or 3) add the location of the component to the system path if it
is installed elsewhere.  [C:\Projects\webmonkeys\node_modules\webmonkeys\node_m
odules\gl\build\binding.sln]
prebuild ERR! build error
prebuild ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuil
d.exe` failed with exit code: 1
prebuild ERR! stack     at ChildProcess.onExit (C:\Projects\webmonkeys\node_modu
les\webmonkeys\node_modules\gl\node_modules\node-gyp\lib\build.js:276:23)
prebuild ERR! stack     at emitTwo (events.js:87:13)
prebuild ERR! stack     at ChildProcess.emit (events.js:172:7)
prebuild ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_p
rocess.js:200:12)
prebuild ERR! not ok
prebuild ERR! build Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuil
d.exe` failed with exit code: 1
prebuild ERR! build     at ChildProcess.onExit (C:\Projects\webmonkeys\node_modu
les\webmonkeys\node_modules\gl\node_modules\node-gyp\lib\build.js:276:23)
prebuild ERR! build     at emitTwo (events.js:87:13)
prebuild ERR! build     at ChildProcess.emit (events.js:172:7)
prebuild ERR! build     at Process.ChildProcess._handle.onexit (internal/child_p
rocess.js:200:12)
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\
node_modules\\npm\\bin\\npm-cli.js" "install" "webmonkeys"
npm ERR! node v4.4.7
npm ERR! npm  v2.15.8
npm ERR! code ELIFECYCLE

npm ERR! gl@4.0.2 install: `prebuild --install`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the gl@4.0.2 install script 'prebuild --install'.
npm ERR! This is most likely a problem with the gl package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     prebuild --install
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs gl
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR!     npm owner ls gl
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Projects\webmonkeys\npm-debug.log

C:\Projects\webmonkeys>
@VictorTaelin
Copy link
Owner

Hello. This is an issue with the headless-gl package. I've made it an optional dependency, so, if you only want to use WebMonkeys on the browser, please try again and it might work. Otherwise, you should probably open an issue there.

@goldenratio
Copy link
Author

Thanks for the reply.
I tried again.. npm install was success but got warnings because of headless-gl.
Since it is a node module - I used browserify to run on browser - got some errors.

C:\Projects\webmonkeys>npm install webmonkeys
-
> gl@4.0.2 install C:\Projects\webmonkeys\node_modules\webmonkeys\node_modules\g
l
> prebuild --install

prebuild WARN install error: 126\\?\C:\Projects\webmonkeys\node_modules\webmonke
ys\node_modules\gl\build\Release\webgl.node
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe".
 To fix this, 1) install the .NET Framework 2.0 SDK, 2) install Microsoft Visua
l Studio 2005 or 3) add the location of the component to the system path if it
is installed elsewhere.  [C:\Projects\webmonkeys\node_modules\webmonkeys\node_m
odules\gl\build\binding.sln]
prebuild ERR! build error
prebuild ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuil
d.exe` failed with exit code: 1
prebuild ERR! stack     at ChildProcess.onExit (C:\Projects\webmonkeys\node_modu
les\webmonkeys\node_modules\gl\node_modules\node-gyp\lib\build.js:276:23)
prebuild ERR! stack     at emitTwo (events.js:87:13)
prebuild ERR! stack     at ChildProcess.emit (events.js:172:7)
prebuild ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_p
rocess.js:200:12)
prebuild ERR! not ok
prebuild ERR! build Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuil
d.exe` failed with exit code: 1
prebuild ERR! build     at ChildProcess.onExit (C:\Projects\webmonkeys\node_modu
les\webmonkeys\node_modules\gl\node_modules\node-gyp\lib\build.js:276:23)
prebuild ERR! build     at emitTwo (events.js:87:13)
prebuild ERR! build     at ChildProcess.emit (events.js:172:7)
prebuild ERR! build     at Process.ChildProcess._handle.onexit (internal/child_p
rocess.js:200:12)
npm WARN optional dep failed, continuing gl@4.0.2
webmonkeys@1.4.4 node_modules\webmonkeys

C:\Projects\webmonkeys>browserify main.js -o target/bundle.js
Error: Cannot find module 'gl' from 'C:\Projects\webmonkeys\node_modules\WebMonk
eys\src'
    at C:\Users\karthikeyan\AppData\Roaming\npm\node_modules\browserify\node_mod
ules\resolve\lib\async.js:46:17
    at process (C:\Users\karthikeyan\AppData\Roaming\npm\node_modules\browserify
\node_modules\resolve\lib\async.js:173:43)
    at ondir (C:\Users\karthikeyan\AppData\Roaming\npm\node_modules\browserify\n
ode_modules\resolve\lib\async.js:188:17)
    at load (C:\Users\karthikeyan\AppData\Roaming\npm\node_modules\browserify\no
de_modules\resolve\lib\async.js:69:43)
    at onex (C:\Users\karthikeyan\AppData\Roaming\npm\node_modules\browserify\no
de_modules\resolve\lib\async.js:92:31)
    at C:\Users\karthikeyan\AppData\Roaming\npm\node_modules\browserify\node_mod
ules\resolve\lib\async.js:22:47
    at FSReqWrap.oncomplete (fs.js:82:15)

C:\Projects\webmonkeys>

I think it will be easier if you have dist or bin folder and distribute the final js files (browser and headless)

@VictorTaelin
Copy link
Owner

I think it is a good idea, also add a "script" to package.json and browserify as yet another optional dep. I don't have the time now, but I'd accept a pr.

@davidmarkclements
Copy link

just a note - you can keep the module as one package (my preference) and solve this by using require('g' + 'l') in code - this stops browserify from seeing the require

@davidmarkclements
Copy link

also @goldenratio you're going to hit that problem for any C dependency - on Windows you have to setup your machine to compile C code (for native modules)

@goldenratio
Copy link
Author

goldenratio commented Aug 26, 2016

It seems we have simple API to do awesome stuff in GPU.
But setting it up needs million dependencies :)

I am looking for something like this.. :D


<script src="webmonkeys.js"></script>
<script>
var monkeys = new WebMonkeys();

// Sends an array of numbers to the GPU
monkeys.set("nums", [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);

// Employs 16 monkeys to work in parallel on the task of squaring each number
monkeys.work(16, "nums(i) := nums(i) * nums(i);");

// Receives the result back
console.log(monkeys.get("nums"));

</script>

@VictorTaelin
Copy link
Owner

VictorTaelin commented Aug 26, 2016

@goldenratio that should work now. Just add <script src="webmonkeys.js"></script> (you can minify it if you want) and call var monkeys = new WebMonkeys();.

@goldenratio
Copy link
Author

Thanks! works now.
sorry for the trouble :)

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

3 participants