3

I'm having issues moving my site from Cloud9 to DigitalOcean.

Most components seem to have installed (though ase-tools and node-gd can't be found), but a few things aren't working, and I get these errors when installing.

root@lospec:~/lospec# npm install
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN prefer global [email protected] should be installed with -g

> [email protected] install /root/lospec/node_modules/node-gd
> node-gyp rebuild

./util.sh: 1: ./util.sh: pkg-config: not found
gyp: Call to './util.sh png16' returned exit status 0 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 (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:305:16)
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_process.js:215:12)
gyp ERR! System Linux 4.4.0-63-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /root/lospec/node_modules/node-gd
gyp ERR! node -v v6.10.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm ERR! Linux 4.4.0-63-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! node v6.10.0
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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-gd 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-gd
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls node-gd
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /root/lospec/npm-debug.log

I can't tell what's really causing the error. I think node-gd, node-gyp, pkg-config?

Here's my package.json: http://pastebin.com/raw/saykdjT2

3
  • do you have the latest version of NPM installed and node.js ? Commented Feb 24, 2017 at 17:46
  • node is v6.10.0; npm is 3.10.10 Commented Feb 24, 2017 at 17:47
  • Feel free to drop your questions on the repo page on github, that way I see them earlier and I can help you out. Commented Apr 19, 2017 at 8:23

3 Answers 3

3

These types of errors are pretty common when using npm packages which require native building (c++) on your machine. The package node-gyp is what builds native dependencies for your environment. I would guess you probably need gcc, python 2.7, and make on that machine.

See node-gyp dependencies for more information.

UPDATE Per https://www.digitalocean.com/community/questions/node-gyp-rebuild-fails-on-install could you attempt the following:

sudo npm install -g node-gyp@latest sudo npm explore -g npm -- npm i node-gyp@latest

If those don't work, it states that possibly deleting the app and pushing it again fresh may fix it.

Sign up to request clarification or add additional context in comments.

2 Comments

I used "sudo apt-get install build-essential" which I think installed make. I have python version 2.7.12
@stackers I updated with some more things you could try.
2

pkg-config is not a Node-related module. It is a system-level build tool used by many lower-level packages as part of their build process. However, it is used by some NPM modules that include native (e.g. C-language) code components so they can be built. node-gd has such a requirement, and has platform-specific dependency installation requirements listed in their documentation README:

https://github.com/y-a-v-a/node-gd

You will need to install this dependency before attempting to install node-gd on that system.

1 Comment

Indeed node-gd uses pkg-config. It is used to get information about how libgd is built on your environment. libgd depends on several other system libraries, mostly concerning processing data for png, jpeg, tiff, etc. images.
0

I was also facing the same error and tried to a lot to find out the solution but after doing so much drama in google I got to know something to resolve this issue.

Generally, this issue will happen because of the installed node version in your project. So, first, you have to install the 'nvm-setup.exe' file from this URL: https://github.com/coreybutler/nvm-windows/releases . After that check node version in your porject and open command prompt and run as administrator and run this command: nvm use 14.17.6 (here, version number will be based on your project). Now, you can install node module and it won't give you error. I hope it will works for you.

Thanks,

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.