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

error installing with npm in windows 10 #398

Open
brakdag opened this issue May 25, 2018 · 25 comments
Open

error installing with npm in windows 10 #398

brakdag opened this issue May 25, 2018 · 25 comments
Milestone

Comments

@brakdag
Copy link

brakdag commented May 25, 2018

npm i robotjs don't work
not install in windows 10

Possible Solution

not idea

Context

Your Environment

  • RobotJS version: npm version last
  • Node.js version: 8.11.2
  • npm version: 5.6.0
  • Operating System: Windows 10 Home 64x
@brakdag brakdag changed the title error installing npm in windows 10 error installing with npm in windows 10 May 25, 2018
@antoniojps
Copy link

antoniojps commented May 27, 2018

It might be worth updating Node before doing the instructions below.

Run this command from an administrative shell to install the "software" dependencias (Visual Studio, Python) on windows:
npm install --global --production windows-build-tools, recent feedback has been using npm install -g windows-build-tools as an alternative.

Install node-gyp globally:
npm install -g node-gyp

Then try installing the package again:
npm install robotjs

This solved the issue for me.

@zircuitz
Copy link

I am having issues as well. Same Windows as @brakdag
I did install all the packages as @antoniojps mentions here. But when I try to initialize the library, I still get an error message:

Uncaught Exception: 
Error: A dynamic link library (DLL) initialization routine failed. 
    at process.module.(anomjmous function) [as dlopen] (ELECTRON 
    at Object.ModuIe._extensions..node 
    at Object.module.(anonymous function) [as .node] (ELECTRON 
    at Module.load 
    at tryModuIeLoad 
    at Function.ModuIe._Ioad (module.js:4963) 
    at Module.require 
    at require (internal/module.js:11:18) 
    at 
(C: \ Users\AIexa n d 170) 
at Object. < anonymous> 

@sbucaille
Copy link

Same here, can't install robotjs, I did what @antoniojps advised, the 3 commands, here is the last one :
image

Someone knows where does it come from ?

Thanks a lot :)

@Deltatiger
Copy link
Collaborator

This seems to be a problem with the version requirements for NodeJS recompiled binaries.
The latest release does not have binaries for Windows 10 64Bit. When the node-pre-gyp fails due to lack of binaries, it falls back to building robotjs. For that you need some prerequisites, which are listed in the readme (https://github.com/octalmage/robotjs#building).
Can you try installing the required items and then trying again?

@lgh06
Copy link

lgh06 commented Jul 7, 2018

cannot install either.
win10: 1803 17134.5
node: v8.11.1
npm: 5.6.0
with windows-build-tools installed.

C:\Users\liu\.node-gyp\8.11.1\x64\node.lib : fatal error LNK1127: library is corrupt [F:\dev\robot\node_modules\robotjs
\build\robotjs.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (E:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "E:\\Program Files\\nodejs\\node.exe" "E:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd F:\dev\robot\node_modules\robotjs
gyp ERR! node -v v8.11.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! robotjs@0.5.1 install: `prebuild-install || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the robotjs@0.5.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

@lgh06
Copy link

lgh06 commented Jul 9, 2018

it worked, after I install a newer nodejs 8.11.3

@pramodDesign
Copy link

pramodDesign commented Aug 17, 2018

When I try to run my project got following error:
0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files (x86)\nodejs\node.exe',
1 verbose cli 'C:\Program Files (x86)\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'start' ]
2 info using npm@3.6.0
3 info using node@v5.6.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle imdevelopment-frontend@0.1.0prestart: imdevelopment-frontend@0.1.0
6 silly lifecycle imdevelopment-frontend@0.1.0
prestart: no script for prestart, continuing
7 info lifecycle imdevelopment-frontend@0.1.0start: imdevelopment-frontend@0.1.0
8 verbose lifecycle imdevelopment-frontend@0.1.0
start: unsafe-perm in lifecycle true
9 verbose lifecycle imdevelopment-frontend@0.1.0start: PATH: C:\Program Files (x86)\nodejs\node_modules\npm\bin\node-gyp-bin;E:\im-frontend\frontend\node_modules.bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\QuickTime\QTSystem;C:\Program Files (x86)\Skype\Phone;C:\Program Files\Microsoft SQL Server\110\Tools\Binn;C:\Program Files\Git\cmd;C:\Program Files\TortoiseGit\bin;C:\Program Files (x86)\nodejs;C:\WINDOWS\System32\OpenSSH;C:\Ruby24-x64\bin;C:\Ruby24\bin;C:\Program Files\Microsoft VS Code\bin;C:\Users\vihnu pramod\AppData\Local\Microsoft\WindowsApps;C:\Users\vihnu pramod\AppData\Roaming\npm;
10 verbose lifecycle imdevelopment-frontend@0.1.0
start: CWD: E:\im-frontend\frontend
11 silly lifecycle imdevelopment-frontend@0.1.0start: Args: [ '/d /s /c', 'npm-run-all -p watch-css start-js' ]
12 silly lifecycle imdevelopment-frontend@0.1.0
start: Returned: code: 1 signal: null
13 info lifecycle imdevelopment-frontend@0.1.0~start: Failed to exec start script
14 verbose stack Error: imdevelopment-frontend@0.1.0 start: npm-run-all -p watch-css start-js
14 verbose stack Exit status 1
14 verbose stack at EventEmitter. (C:\Program Files (x86)\nodejs\node_modules\npm\lib\utils\lifecycle.js:232:16)
14 verbose stack at emitTwo (events.js:100:13)
14 verbose stack at EventEmitter.emit (events.js:185:7)
14 verbose stack at ChildProcess. (C:\Program Files (x86)\nodejs\node_modules\npm\lib\utils\spawn.js:24:14)
14 verbose stack at emitTwo (events.js:100:13)
14 verbose stack at ChildProcess.emit (events.js:185: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 imdevelopment-frontend@0.1.0
16 verbose cwd E:\im-frontend\frontend
17 error Windows_NT 10.0.17134
18 error argv "C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (x86)\nodejs\node_modules\npm\bin\npm-cli.js" "start"
19 error node v5.6.0
20 error npm v3.6.0
21 error code ELIFECYCLE
22 error imdevelopment-frontend@0.1.0 start: npm-run-all -p watch-css start-js
22 error Exit status 1
23 error Failed at the imdevelopment-frontend@0.1.0 start script 'npm-run-all -p watch-css start-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 imdevelopment-frontend package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error npm-run-all -p watch-css start-js
23 error You can get information on how to open an issue for this project with:
23 error npm bugs imdevelopment-frontend
23 error Or if that isn't available, you can get their info via:
23 error npm owner ls imdevelopment-frontend
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

@Deltatiger
Copy link
Collaborator

@pramodDesign What did you try to run? Could you give us more information?

@A-312
Copy link

A-312 commented Nov 28, 2018

@pramodDesign

19 error node v5.6.0
20 error npm v3.6.0

You've old version and you need to "have the latest version of node.js and npm installed."

@Kilometres
Copy link

I had the exact same problem, I tried the stable build the latest build and all the sorts. But i was using node x64 bit, uninstall that and download node x86 (32 bit). It seems to solve the problems and has not caused me an error since. Hope this helps.

Ran the one command:
npm install robotjs

PC Specs:
System Type: 64-bit Operating System, x4-based processor
Operating System: Windows 10 Pro

@jimfangx
Copy link

As of today, the latest windows build tools (5.1.0) freezes after installing python.
image
So use version 4.0.0 instead of 5.1.0 -> npm install --global --production windows-build-tools@4.0.0

@lucasctd
Copy link

It might be worth updating Node before doing the instructions below.

Run this command from an administrative shell to install the "software" dependencias (Visual Studio, Python) on windows:
npm install --global --production windows-build-tools

Install node-gyp globally:
npm install -g node-gyp

Then try installing the package again:
npm install robotjs

This solved the issue for me.

@antoniojps It does not work for me. I always get the same error:

image
It seems I can't install robotjs on windows...

@blizzard190
Copy link

For the people who can't install robotjs because of node-gyp, I've been able to fix it by downloading node version 10. The person who told me this way of fixing it, told me that the npm install for this libary uses a file that is nolonger included in node version 12, for this reason downloading an older version seems to fix it. I can't remember the source so sorry for that.

@lucasctd I had the same error the method above worked for me but I would check your node version first before trying it.

ps: I did this for windows, I have no clue if this will work for other systems.

@Tymski
Copy link

Tymski commented Jul 5, 2019

Finally, after 2 years I found a solution that works for me:
npm install -g windows-build-tools
instead of
npm install --global --production windows-build-tools

@evertdhont
Copy link

@Tymski this looks like the way to go! After installing it several times it finally installed correctly. Thanks!

@AfzalivE
Copy link

For anyone still having a problem with this:

  • Use NodeJS 10 (LTS)
  • Try npm install -g windows-build-tools --vs2017

@oktapodia oktapodia added this to the v0.6.0 milestone Nov 24, 2019
@oktapodia
Copy link
Collaborator

The support will be improved in the near next release

@liketurbo
Copy link

  1. Please use nvm and switch to the version node@8
  2. Complete installation of all prerequisites from node-gyp

@Tymski
Copy link

Tymski commented Jan 15, 2020

Another thing you can try is to install node-gyp locally as a development dependency

npm i --save-dev node-gyp

npm i robotjs works for me after that (remember to run as administrator) whereas it doesn't work with node-gyp installed globally for some reason

@shawn-mty
Copy link

shawn-mty commented Dec 9, 2020

I tried running Node14.15.1 and I was getting this error.

If you have node installed on windows as an actual app do the following steps to get rid of this error.

  1. uninstall nodejs from add or remove programs
  2. install nvm globally and install/use node version 12.0.0 ( https://github.com/coreybutler/nvm-windows)
  3. npm i robotjs

Fool proof.

Cheers

@Tymski
Copy link

Tymski commented Dec 10, 2020

@ShawnMeister you link a solution for Linux/Mac
(https://github.com/nvm-sh/nvm#installing-and-updating)
"nvm is a for Mac/Linux only"
whereas this issue is for Windows 10
"error installing with npm in windows 10"

@shawn-mty
Copy link

@ShawnMeister you link a solution for Linux/Mac
(https://github.com/nvm-sh/nvm#installing-and-updating)
"nvm is a for Mac/Linux only"
whereas this issue is for Windows 10
"error installing with npm in windows 10"

Ahh my mistake. I edited it

@Abuzbek
Copy link

Abuzbek commented May 21, 2023

how to do this in mac os

@Satish-Thapa
Copy link

It might be worth updating Node before doing the instructions below.

Run this command from an administrative shell to install the "software" dependencias (Visual Studio, Python) on windows: npm install --global --production windows-build-tools, recent feedback has been using npm install -g windows-build-tools as an alternative.

Install node-gyp globally: npm install -g node-gyp

Then try installing the package again: npm install robotjs

This solved the issue for me.

npm install --global --production windows-build-tools now its change to this npm install -g node-gyp and node-gyp rebuild

@ftyszyx
Copy link

ftyszyx commented Sep 19, 2024

Robotjs (https://github.com/octalmage/robotjs)is build use V8 API.So it must be rebuilt for different Node versions.
This is a big trouble when installing on a platform that has no build environment..
So I rewrapped Robotjs with Node API and prebuilt it. Now you can install robotjs_addon with just one command
npm install robotjs_addon
And it is compatible with different Node versions. It's open source. You can check it out if you are interested.https://github.com/ftyszyx/robotjs
Warm: some api is removed,because there is no need for me, you can help to improve.

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