when I run the command "npm install robotjs -g" it gives me this error.
robotjs#0.5.1 install C:\Users\Ehsan\AppData\Roaming\npm\node_modules\robotjs
prebuild-install || node-gyp rebuild
prebuild-install WARN install No prebuilt binaries found
(target=8.11.3 runtime=node arch=x64 platform=win32)
C:\Users\Ehsan\AppData\Roaming\npm\node_modules\robotjs>if not defined
npm_config_node_gyp (node "C:\Program
Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js"
rebuild ) else (node "C:\Program
Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js"
rebuild ) C:\Program
Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\input.py:891:
Warning: 'as' will become a reserved keyword in Python 2.6 Traceback
(most recent call last): File "C:\Program
Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\gyp_main.py",
line 13, in
import gyp File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp__init__.py",
line 8, in
import gyp.input File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\input.py",
line 891
except ImportError as e:
^ SyntaxError: invalid syntax gyp ERR! configure error gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (C:\Program
Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:336:16)
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.17133 gyp ERR! command "C:\Program
Files\nodejs\node.exe" "C:\Program
Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js"
"rebuild" gyp ERR! cwd
C:\Users\Ehsan\AppData\Roaming\npm\node_modules\robotjs gyp ERR! node
-v v8.11.3 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.
npm ERR! A complete log of this run can be found in: npm ERR!
C:\Users\Ehsan\AppData\Roaming\npm-cache_logs\2018-10-29T09_19_13_980Z-debug.log
I was able to install (and run) robotjs in ubuntu 20.04:
sudo apt install -y nodejs npm
sudo apt install -y libxtst-dev
sudo apt install -y libpng++-dev
npm install robotjs
Got some warnings, but robotjs was successfully installed :)
Related
Why do I get this strange error when doing sudo npm install npm? I also sometimes get it when trying to install other modules!
Error:
> scrypt#6.0.3 preinstall /home/user/code/project/api_v0.8/node_modules/scrypt
> node node-scrypt-preinstall.js
> scrypt#6.0.3 install /home/user/code/project/api_v0.8/node_modules/scrypt
> node-gyp rebuild
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/user/code/project/api_v0.8/node_modules/scrypt/build'
gyp ERR! System Linux 4.20.0-042000-generic
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/user/code/project/api_v0.8/node_modules/scrypt
gyp ERR! node -v v9.11.2
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN api_v0.8#1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! scrypt#6.0.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the scrypt#6.0.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
What can I do, to have a clean install of my packages?
To solve this, install node version manager:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
user node v8.15.0:
nvm install 8.15.0
nvm use 8.15.0
When run my project package, i have getting above title error, after i trying to install that packages using
npm install xml2json
but, i have getting below error only, can you pls give me suggestions or idea to get out from this issue...
D:\xampp\htdocs\podio>npm install xml2json
> node-expat#2.3.16 install D:\xampp\htdocs\podio\node_modules\node-expat
> node-gyp rebuild
D:\xampp\htdocs\podio\node_modules\node-expat>if not defined npm_config_node_gyp
(node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_mo
dules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild )
Warning: Missing input files:
D:\xampp\htdocs\podio\node_modules\node-expat\build\deps\libexpat\..\..\..\deps\
libexpat\version.c
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. [D:\xampp\htdocs\podio\node_modules\node-expat\build\b
inding.sln]
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\
npm\node_modules\node-gyp\lib\build.js:276:23)
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_proces
s.js:219:12)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodej
s\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\xampp\htdocs\podio\node_modules\node-expat
gyp ERR! node -v v6.11.5
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
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" "xml2json"
npm ERR! node v6.11.5
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! node-expat#2.3.16 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-expat#2.3.16 install script 'node-gyp rebuild'.
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 node-expat package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs node-expat
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls node-expat
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! D:\xampp\htdocs\podio\npm-debug.log
Edit :: 1
After i have installed updated visual studio 2005 to 2012 im getting below error when i have run npm install xml2json and npm install xml2json --unsafe-perm,
C:\Users\Desktop\New folder\action>npm install xml2json
> node-expat#2.3.16 install C:\Users\Hoffensoft\node_modules\node-expat
> node-gyp rebuild
C:\Users\Hoffensoft\node_modules\node-expat>if not defined npm_config_node_gyp (
node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modu
les\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild )
Warning: Missing input files:
C:\Users\Hoffensoft\node_modules\node-expat\build\deps\libexpat\..\..\..\deps\li
bexpat\version.c
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
xmlparse.c
xmltok.c
xmlrole.c
c:\users\hoffensoft\node_modules\node-expat\deps\libexpat\lib\siphash.h(201): w
arning C4244: 'initializing' : conversion from '__int64' to 'char', possible lo
ss of data (..\..\..\deps\libexpat\lib\xmlparse.c) [C:\Users\Hoffensoft\node_mo
dules\node-expat\build\deps\libexpat\expat.vcxproj]
win_delay_load_hook.cc
expat.vcxproj -> C:\Users\Hoffensoft\node_modules\node-expat\build\Release\\l
ibexpat.lib
node-expat.cc
win_delay_load_hook.cc
C:\Users\Hoffensoft\node_modules\nan\nan.h(75): fatal error C1060: compiler is
out of heap space (..\node-expat.cc) [C:\Users\Hoffensoft\node_modules\node-exp
at\build\node_expat.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\
npm\node_modules\node-gyp\lib\build.js:276:23)
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_proces
s.js:219:12)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodej
s\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Hoffensoft\node_modules\node-expat
gyp ERR! node -v v6.11.5
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\Hoffensoft\pac
kage.json'
npm WARN Hoffensoft No description
npm WARN Hoffensoft No repository field.
npm WARN Hoffensoft No README data
npm WARN Hoffensoft No license field.
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" "xml2json"
npm ERR! node v6.11.5
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! node-expat#2.3.16 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-expat#2.3.16 install script 'node-gyp rebuild'.
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 node-expat package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs node-expat
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls node-expat
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\Hoffensoft\Desktop\New folder\action\npm-debug.log
Thanks in advance, Gopal R
I have solved this
Use this command npm install xml2json-light
and change let parser = require('xml2json'); to let parser = require('xml2json-light');
It worked for me
I have solved this. If you notice this part of the command else (node "" rebuild ) what I think is happening is that it is incorrectly evaluating if not defined npm_config_node_gyp as false and trying to run nothing instead of node-gyp. What you need to do is define your npm_config_node_gyp variable. You can do this like so:
export npm_config_node_gyp=<PATH_TO_NODE_GYP_PACKAGE_FOLDER> remember that Windows will need double backslashes. For me, it looked like this:
export npm_config_node_gyp=C:\\Users\\781990\\AppData\\Roaming\\nvm\\v6.11.0\\node_modules\\node-gyp
Edit:
There is another step after my fix. When executing my code, the expat bindings were missing. To fix it, add the bin folder and node-gyp executable to the npm_config_node_gyp variable and run node-gyp rebuild in the node_modules\node-expat folder. e.g.
export npm_config_node_gyp=C:\\Users\\781990\\AppData\\Roaming\\nvm\\v6.11.0\\node_modules\\node-gyp\\bin\\node-gyp.js
cd node_modules\node-expat
node-gyp rebuild
I am trying to install imagemagick-native. It will through an error
i am using command to install.
npm install imagemaick-native --save
> imagemagick-native#1.9.3 install /home/kspx/Desktop/MyData/Projects/Node/vcc-api/node_modules/imagemagick-native
> node-gyp rebuild
/bin/sh: 1: Magick++-config: not found
gyp: Call to 'Magick++-config --ldflags --libs' returned exit status 127 while in 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 (/home/kspx/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:308:16)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:12)
gyp ERR! System Linux 4.4.0-75-generic
gyp ERR! command "/usr/bin/nodejs" "/home/kspx/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/kspx/Desktop/MyData/Projects/Node/vcc-api/node_modules/imagemagick-native
gyp ERR! node -v v4.8.3
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok
WARN VinCompass#0.0.1 No description
npm WARN VinCompass#0.0.1 No repository field.
npm WARN VinCompass#0.0.1 No license field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! imagemagick-native#1.9.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the imagemagick-native#1.9.3 install script 'node-gyp rebuild'.
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 imagemagick-native package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs imagemagick-native
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls imagemagick-native
npm ERR! There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/kspx/.npm/_logs/2017-05-15T05_30_58_940Z-debug.log
please guys give me the solution. how can I fix this problem?
i was try all the ubuntu commond. even I update node and npm to latest version. atill Getting the sam error.
As per documentation.
Install ImageMagick with headers before installing this module. Tested with ImageMagick 6.7.7 on CentOS 6 and Mac OS X Lion, Ubuntu 12.04 .
brew install imagemagick
or
sudo yum install ImageMagick-c++ ImageMagick-c++-devel
or
sudo apt-get install libmagick++-dev
Make sure you can find Magick++-config in your PATH. Packages on some newer distributions, such as Ubuntu 16.04, might be missing a link into /usr/bin. If that is the case, do this.
sudo ln -s `ls /usr/lib/\`uname -p\`-linux-gnu/ImageMagick-*/bin-Q16/Magick++-config | head -n 1` /usr/local/bin/
Then do :
npm install imagemagick-native
***Unable to run npm command "npm install -g tty.js".
Here is the error log I am getting :***
=D:\Users\pjha\AppData\Roaming\npm\node_modules\tty.js\node_modules\ws
(node-gyp rebuild 2> builderror.log) || (exit 0)
D:\Users\pjha\AppData\Roaming\npm\node_modules\tty.js\node_modules\ws>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\....\node_modules\node-gyp\b
in\node-gyp.js" rebuild ) else (node "" rebuild )
pty.js#0.3.1 install D:\Users\pjha\AppData\Roaming\npm\node_modules\tty.js\node_modules\pty.js
node-gyp rebuild
D:\Users\pjha\AppData\Roaming\npm\node_modules\tty.js\node_modules\pty.js>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\....\node_modules\node-g
yp\bin\node-gyp.js" rebuild ) else (node "" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:449:14)
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:404:11
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:264:29
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:123:15)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd D:\Users\pjha\AppData\Roaming\npm\node_modules\tty.js\node_modules\pty.js
gyp ERR! node -v v6.10.2
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
D:\Users\pjha\AppData\Roaming\npm
`-- (empty)
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "tty.js"
npm ERR! node v6.10.2
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! pty.js#0.3.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the pty.js#0.3.1 install script 'node-gyp rebuild'.
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 pty.js package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs pty.js
npm ERR! Or if that isn't available, you can get their info via:`enter code here`
npm ERR! npm owner ls pty.js
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! D:\Praful\WorkSpaces\NodeJsWorkSpace\Test\npm-debug.log
See this issue on GitHub - #151: npm install pty.js` failed on Windows 10:
https://github.com/chjj/pty.js/issues/151
And this - #54: can't install on windows:
https://github.com/chjj/pty.js/issues/54
There are some solutions that people recommend. It's hard to tell which one will work for you but you should find some info in the comments to those issues.
I'm trying to install a package for meteor on the command line interface, but I keep getting an error. I have tried reinstalling node and npm, but error persists. I have no idea how to proceed.
Here is the message I get in the CLI:
USERs-MacBook-Pro:meteor USER$ sudo npm -g install meteor-em
> fibers#1.0.1 install /usr/local/lib/node_modules/meteor-em/node_modules/fibers
> node ./build.js
gyp WARN EACCES user "root" does not have permission to access the dev dir "/Users/USER/.node-gyp/0.10.34"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/meteor-em/node_modules/fibers/.node-gyp"
/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py:873: Warning: 'as' will become a reserved keyword in Python 2.6
Traceback (most recent call last):
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 11, in <module>
import gyp
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 8, in <module>
import gyp.input
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 873
except ImportError as e:
^
SyntaxError: invalid syntax
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:343:16)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:820:12)
gyp ERR! System Darwin 13.4.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/meteor-em/node_modules/fibers
gyp ERR! node -v v0.10.34
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok
Build failed
npm ERR! Darwin 13.4.0
npm ERR! argv "node" "/usr/local/bin/npm" "-g" "install" "meteor-em"
npm ERR! node v0.10.34
npm ERR! npm v2.1.14
npm ERR! code ELIFECYCLE
npm ERR! fibers#1.0.1 install: `node ./build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the fibers#1.0.1 install script 'node ./build.js'.
npm ERR! This is most likely a problem with the fibers package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./build.js
npm ERR! You can get their info via:
npm ERR! npm owner ls fibers
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/USER/Code/Meteor/npm-debug.log
USERs-MacBook-Pro:meteor USER$
Updates:
-Interesting detail: I was never prompted for my password
-found a discussion thread on the topic. Reading through it now:
-just installed node-gyp
-also installed node-fibers
I did an "apt-get install -y build-essential" and everything was fine after that ;-)
I just upgraded from python 2.5.4 to 2.7.9. I was told that that might help....And it did!