0

My goal is to set up a Dev environment for ApostropheCMS (https://apostrophecms.org/docs/) on my Windows 10 machine. To achieve the goal, I have CentOS running in a Docker container, and I am following these instructions to install Apostrophe: https://apostrophecms.org/docs/tutorials/intermediate/deployment.html

I am more-or-less able to get through the following installs error-free and warning-free:

## My docker command, to get CentOS bash in a new container
docker run -it centos bash

## Apostrophe CMS install script, run inside CentOS Bash
# Grab some command line basics
yum install wget rsync perl git nano
# Allow the use of the EPEL ("Extra Packages for Enterprise Linux") repository
yum install epel-release
# Front end proxy webserver
yum install nginx
# Install node, imagemagick, npm, and compiler tools so an efficient
# mongo driver can be compiled by npm
yum install gcc automake autoconf libtool make nodejs ImageMagick npm
# Install mongodb
yum install mongodb-server mongodb
# Allow non-root users to run command line applications installed with
# "npm install -g", otherwise it is not very useful
chmod -R a+r /usr/lib/node_modules/

However I get errors or warnings with the two commands for installing forever and mechanic from npm. The errors are in the appendix below.

# Used to run things indefinitely restarting as needed
npm install -g forever
# Used to manage nginx
npm install -g mechanic

My questions are:

  1. Do I even need forever and mechanic for a dev instance? I.e., one where all I will be doing is developing locally and deploying to a server?
  2. If yes, how can I get these installed error-free?

I realize these are noob-level questions. I am new to CentOS, Docker, and Apostrophe. Thank you for your patience, understanding, and advice.


APPENDIX: ERRORS

The second-to-last command:

# Used to run things indefinitely restarting as needed
npm install -g forever

Gives me:

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/forever/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

The final command:

# Used to manage nginx
npm install -g mechanic

Gives me:

gyp WARN EACCES user "undefined" does not have permission to access the dev dir "/root/.node-gyp/6.14.2"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/lib/node_modules/mechanic/node_modules/fs-ext/.node-gyp"
make: Entering directory `/usr/lib/node_modules/mechanic/node_modules/fs-ext/build'
  CXX(target) Release/obj.target/fs-ext/fs-ext.o
make: g++: Command not found
make: *** [Release/obj.target/fs-ext/fs-ext.o] Error 127
make: Leaving directory `/usr/lib/node_modules/mechanic/node_modules/fs-ext/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules.bundled/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_process.js:219:12)
gyp ERR! System Linux 4.9.87-linuxkit-aufs
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build"
gyp ERR! cwd /usr/lib/node_modules/mechanic/node_modules/fs-ext
gyp ERR! node -v v6.14.2
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
/usr/lib
`-- (empty)

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/mechanic/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! Linux 4.9.87-linuxkit-aufs
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "-g" "mechanic"
npm ERR! node v6.14.2
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp configure build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp configure build'.
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 fs-ext package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp configure build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs fs-ext
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls fs-ext
npm ERR! There is likely additional logging output above.

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

1 Answer 1

1

Indeed, there were some oversights in this recipe on our documentation site. The critical yum package you were missing is gcc-c++.

yum install gcc-c++

In addition I have updated the entire recipe to include better versions of node and mongodb from better repositories. (The EPEL repository does offer a version of MongoDB but it is very out of date. The version of node in that repository is a little better, but why not have 8.x, since it's the current long term support release.)

Thanks for bringing it to our attention.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.