error when install node modules ---common.gypi not found - javascript

when I run npm install , the node modules included in the package.json should be installed, however, there are following errors:
npm http 304 https://registry.npmjs.org/zeparser/0.0.5
npm http GET https://registry.npmjs.org/commander
npm http GET https://registry.npmjs.org/tinycolor
npm http GET https://registry.npmjs.org/options
gyp: C:\Documents and Settings\Jicheng An\.node-gyp\0.10.5\common.gypi not found (cwd: c:\Documents and Settings\Jicheng An\csfv_cms_module\node_modules\csfv_misc_module\node_modules\email-templates\node_modules\juice\node_modules\jsdom\node_modules\contextify) while reading includes of 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 (h:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:415:16)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:784:12)
gyp ERR! System Windows_NT 5.1.2600
gyp ERR! command "node" "h:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd c:\Documents and Settings\Jicheng An\csfv_cms_module\node_modules\csfv_misc_module\node_modules\email-templates\node_modules\juice\node_modules\jsdom\node_modules\contextify
gyp ERR! node -v v0.10.5
gyp ERR! node-gyp -v v0.9.5
gyp ERR! not ok
npm http 304 https://registry.npmjs.org/tinycolor
npm http 304 https://registry.npmjs.org/options
npm http 304 https://registry.npmjs.org/commander
npm ERR! Error: ENOENT, lstat 'c:\Documents and Settings\Jicheng An\csfv_cms_module\node_modules\csfv_misc_module\node_modules\email-templates\node_modules\juice\node_modules\jsdom\node_modules\cssstyle\lib\properties\borderBottomWidth.js'
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-#googlegroups.com>
npm ERR! System Windows_NT 5.1.2600
npm ERR! command "h:\\Program Files\\nodejs\\node.exe" "h:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "i"
npm ERR! cwd c:\Documents and Settings\Jicheng An\csfv_cms_module
npm ERR! node -v v0.10.5
npm ERR! npm -v 1.2.18
npm ERR! path c:\Documents and Settings\Jicheng An\csfv_cms_module\node_modules\csfv_misc_module\node_modules\email-templates\node_modules\juice\node_modules\jsdom\node_modules\cssstyle\lib\properties\borderBottomWidth.js
npm ERR! fstream_path c:\Documents and Settings\Jicheng An\csfv_cms_module\node_modules\csfv_misc_module\node_modules\email-templates\node_modules\juice\node_modules\jsdom\node_modules\cssstyle\lib\properties\borderBottomWidth.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack h:\Program Files\nodejs\node_modules\npm\node_modules\fstream\lib\writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! contextify#0.1.6 install: `node-gyp rebuild`
npm ERR! `cmd "/c" "node-gyp rebuild"` failed with 1
npm ERR!
npm ERR! Failed at the contextify#0.1.6 install script.
npm ERR! This is most likely a problem with the contextify 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 their info via:
npm ERR! npm owner ls contextify
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 5.1.2600
npm ERR! command "h:\\Program Files\\nodejs\\node.exe" "h:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "i"
npm ERR! cwd c:\Documents and Settings\Jicheng An\csfv_cms_module
npm ERR! node -v v0.10.5
npm ERR! npm -v 1.2.18
npm ERR! code ELIFECYCLE
npm WARN engine mong.socket.io#0.9.0: wanted: {"node":"0.8.x"} (current: {"node":"v0.10.5","npm":"1.2.18"})
npm http GET https://registry.npmjs.org/passport-openid
npm http GET https://registry.npmjs.org/pkginfo
npm http GET https://registry.npmjs.org/passport-oauth
npm http GET https://registry.npmjs.org/passport-oauth
I don't know what the common.gypi is and why the error happens.
can anyone help me to resolve this problem ?

I believe you module require compilation, most of the modules in npm have precompiled binaries for Win Mac Linux, but this one require compilation with node-gyp. https://github.com/TooTallNate/node-gyp
For Windows it will actually create .sln and .cxproj files for C source files of the module.
And it will do this using Python. After that it will run msbuild to build the solution.
You will need Visual Studio at least express in this case

Related

`npm install npm` gives gyp ERR and npm ERR

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

Node.js npm install express - can't install express, error CERT_UNTRUSTED

I'm trying to install express on Raspberry Pi because I wanto to use it for REST API. The problem is that I get following message and any solution that I found on this site doesn't work.
npm http GET https://registry.npmjs.org/express
npm ERR! Error: SSL Error: CERT_UNTRUSTED
npm ERR! at ClientRequest.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/main.js:525:26)
npm ERR! at ClientRequest.g (events.js:192:14)
npm ERR! at ClientRequest.EventEmitter.emit (events.js:96:17)
npm ERR! at HTTPParser.parserOnIncomingClient [as onIncoming] (http.js:1582:7)
npm ERR! at HTTPParser.parserOnHeadersComplete [as onHeadersComplete] (http.js:111:23)
npm ERR! at CleartextStream.socketOnData [as ondata] (http.js:1485:20)
npm ERR! at CleartextStream.CryptoStream._push (tls.js:544:27)
npm ERR! at SecurePair.cycle (tls.js:898:20)
npm ERR! at EncryptedStream.CryptoStream.write (tls.js:285:13)
npm ERR! at Socket.ondata (stream.js:38:26)
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-#googlegroups.com>
npm ERR! System Linux 4.14.62-v7+
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "express" "--save"
npm ERR! cwd /usr/local/myapp
npm ERR! node -v v0.8.21
npm ERR! npm -v 1.2.11
npm ERR! code ESSL
npm ERR! Error: EACCES, open 'npm-debug.log'
npm ERR! { [Error: EACCES, open 'npm-debug.log'] errno: 3, code: 'EACCES', path: 'npm-debug.log' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Linux 4.14.62-v7+
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "express" "--save"
npm ERR! cwd /usr/local/myapp
npm ERR! node -v v0.8.21
npm ERR! npm -v 1.2.11
npm ERR! path npm-debug.log
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, open 'npm-debug.log'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /usr/local/myapp/npm-debug.log
npm ERR! not ok code 0
Here are some commands that people asked about in other threads :
npm version
http_parser: '1.0',
node: '0.8.21',
v8: '3.11.10.25',
ares: '1.7.5-DEV',
uv: '0.8',
zlib: '1.2.3',
openssl: '1.0.0f',
npm: '1.2.11' }
npm list
pi#raspberrypi:/usr/local/myapp $ npm list
/usr/local/myapp
└── (empty)
I also tried to clear cache but nothing works and I'm stuck.
Thanks for help in advance.
Try this:
npm config set ca ""

Installation of imagemagick-native node with linuxbrew

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".

***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.

NPM: Registry is missing

npm http GET https://registry.npmjs.org/n
npm ERR! Error: failed to fetch from registry: n
npm ERR! at /usr/share/npm/lib/utils/npm-registry-client/get.js:139:12
npm ERR! at cb (/usr/share/npm/lib/utils/npm-registry-client/request.js:31:9)
npm ERR! at Request._callback (/usr/share/npm/lib/utils/npm-registry-client/request.js:136:18)
npm ERR! at Request.callback (/usr/lib/nodejs/request/main.js:119:22)
npm ERR! at Request.<anonymous> (/usr/lib/nodejs/request/main.js:212:58)
npm ERR! at Request.emit (events.js:88:20)
npm ERR! at ClientRequest.<anonymous> (/usr/lib/nodejs/request/main.js:209:10)
npm ERR! at ClientRequest.emit (events.js:67:17)
npm ERR! at CleartextStream.<anonymous> (http.js:1137:11)
npm ERR! at CleartextStream.emit (events.js:67:17)
npm ERR! You may report this log at:
npm ERR! <http://bugs.debian.org/npm>
npm ERR! or use
npm ERR! reportbug --attach /var/www/npm-debug.log npm
npm ERR!
npm ERR! System Linux 3.2.0-58-generic
npm ERR! command "node" "/usr/bin/npm" "install" "-g" "n"
npm ERR! cwd /var/www
npm ERR! node -v v0.6.12
npm ERR! npm -v 1.1.4
npm ERR! message failed to fetch from registry: n
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /var/www/npm-debug.log
npm not ok
I was trying to update the nodejs installation but i couldn't.
I followed the steps here.
Ok so i have answered my own question.
Aparently sudo apt-get install nodejs directly from the repository would only give you a maximum of v.0.06.
So what i did was the following
https://launchpad.net/~chris-lea/+archive/node.js/
i added the PPA, then did the whole install nodejs again.
Afterwhich, the version is now v.0.10
Hope this would help anyone in my case.

Categories