What is the best way to install the MEAN stack on cloud9? Error message when following manual - mean-stack

There seem to be various way to install all the modules of the Mean Stack (mean.io). However, what is the best way to do this in c9.io? I have been trying a lot of things, but I do not seem to get them all. c9.io has dedicated workspaces for NodeJs and a way to install Angular.js, but I want it all, quick, easy and fast!
Note: I tried to create a new workspace (Node.js), deleted all files and run the commands as given in the following link:
http://learn.mean.io/#mean-installation
However, I got the following error message:
john#tut-04-mean:~/workspace $ cd app && npm install
> meanio#0.6.12 preinstall /home/ubuntu/workspace/app/node_modules/meanio
> node ./scripts/preinstall
npm WARN engine mean-cli#0.9.6: wanted: {"node":"0.10.x","npm":"2.1.x"} (current: {"node":"0.10.33","npm":"1.4.28"})
> mean-health#0.1.7 postinstall /home/ubuntu/workspace/app/node_modules/meanio/node_modules/mean-health
> node ./postinstall.js
> mean-cli#0.9.6 preinstall /home/ubuntu/workspace/app/node_modules/meanio/node_modules/mean-cli
> node ./scripts/preinstall
npm WARN optional dep failed, continuing fsevents#0.3.1
npm WARN engine hawk#0.10.2: wanted: {"node":"0.8.x"} (current: {"node":"0.10.33","npm":"1.4.28"})
npm WARN engine sntp#0.1.4: wanted: {"node":"0.8.x"} (current: {"node":"0.10.33","npm":"1.4.28"})
npm WARN engine cryptiles#0.1.3: wanted: {"node":"0.8.x"} (current: {"node":"0.10.33","npm":"1.4.28"})
npm WARN engine hoek#0.7.6: wanted: {"node":"0.8.x"} (current: {"node":"0.10.33","npm":"1.4.28"})
npm WARN engine boom#0.3.8: wanted: {"node":"0.8.x"} (current: {"node":"0.10.33","npm":"1.4.28"})
npm WARN engine hawk#0.10.2: wanted: {"node":"0.8.x"} (current: {"node":"0.10.33","npm":"1.4.28"})
> phantomjs#1.9.12 install /home/ubuntu/workspace/app/node_modules/karma-phantomjs-launcher/node_modules/phantomjs
> node install.js
Downloading https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-linux-x86_64.tar.bz2
Saving to /tmp/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2
Receiving...
/ [==============--------------------------] 36% 0.0s\
Received 12854K total.
Extracting tar contents (via spawned process)
Removing /home/ubuntu/workspace/app/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom
Copying extracted folder /tmp/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2-extract-1416576264996/phantomjs-1.9.8-linux-x86_64 -> /home/ubuntu/workspace/app/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom
Removing /tmp/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2-extract-1416576264996
Writing location.js file
Done. Phantomjs binary available at /home/ubuntu/workspace/app/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/bin/phantomjs
npm WARN engine boom#0.3.8: wanted: {"node":"0.8.x"} (current: {"node":"0.10.33","npm":"1.4.28"})
npm WARN engine cryptiles#0.1.3: wanted: {"node":"0.8.x"} (current: {"node":"0.10.33","npm":"1.4.28"})
npm WARN engine sntp#0.1.4: wanted: {"node":"0.8.x"} (current: {"node":"0.10.33","npm":"1.4.28"})
npm WARN engine hoek#0.7.6: wanted: {"node":"0.8.x"} (current: {"node":"0.10.33","npm":"1.4.28"})
npm WARN engine hawk#0.10.2: wanted: {"node":"0.8.x"} (current: {"node":"0.10.33","npm":"1.4.28"})
> kerberos#0.0.4 install /home/ubuntu/workspace/app/node_modules/mongoose/node_modules/mongodb/node_modules/kerberos
> (node-gyp rebuild 2> builderror.log) || (exit 0)
make: Entering directory `/home/ubuntu/workspace/app/node_modules/mongoose/node_modules/mongodb/node_modules/kerberos/build'
SOLINK_MODULE(target) Release/obj.target/kerberos.node
SOLINK_MODULE(target) Release/obj.target/kerberos.node: Finished
COPY Release/kerberos.node
make: Leaving directory `/home/ubuntu/workspace/app/node_modules/mongoose/node_modules/mongodb/node_modules/kerberos/build'
npm WARN engine hoek#0.7.6: wanted: {"node":"0.8.x"} (current: {"node":"0.10.33","npm":"1.4.28"})
npm WARN engine cryptiles#0.1.3: wanted: {"node":"0.8.x"} (current: {"node":"0.10.33","npm":"1.4.28"})
npm WARN engine boom#0.3.8: wanted: {"node":"0.8.x"} (current: {"node":"0.10.33","npm":"1.4.28"})
npm WARN engine sntp#0.1.4: wanted: {"node":"0.8.x"} (current: {"node":"0.10.33","npm":"1.4.28"})
> bson#0.2.15 install /home/ubuntu/workspace/app/node_modules/mongoose/node_modules/mongodb/node_modules/bson
> (node-gyp rebuild 2> builderror.log) || (exit 0)
make: Entering directory `/home/ubuntu/workspace/app/node_modules/mongoose/node_modules/mongodb/node_modules/bson/build'
CXX(target) Release/obj.target/bson/ext/bson.o
SOLINK_MODULE(target) Release/obj.target/bson.node
SOLINK_MODULE(target) Release/obj.target/bson.node: Finished
COPY Release/bson.node
make: Leaving directory `/home/ubuntu/workspace/app/node_modules/mongoose/node_modules/mongodb/node_modules/bson/build'
> ws#0.4.32 install /home/ubuntu/workspace/app/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
make: Entering directory `/home/ubuntu/workspace/app/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/build'
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
SOLINK_MODULE(target) Release/obj.target/bufferutil.node
SOLINK_MODULE(target) Release/obj.target/bufferutil.node: Finished
COPY Release/bufferutil.node
CXX(target) Release/obj.target/validation/src/validation.o
SOLINK_MODULE(target) Release/obj.target/validation.node
SOLINK_MODULE(target) Release/obj.target/validation.node: Finished
COPY Release/validation.node
make: Leaving directory `/home/ubuntu/workspace/app/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/build'
npm ERR! Error: EACCES, mkdir '/home/ubuntu/.npm/mongodb/1.3.23'
npm ERR! { [Error: EACCES, mkdir '/home/ubuntu/.npm/mongodb/1.3.23']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/home/ubuntu/.npm/mongodb/1.3.23',
npm ERR! parent: 'connect-mongo' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Linux 3.14.13-c9
npm ERR! command "/home/ubuntu/.nvm/v0.10.33/bin/node" "/home/ubuntu/.nvm/v0.10.33/bin/npm" "install"
npm ERR! cwd /home/ubuntu/workspace/app
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! path /home/ubuntu/.npm/mongodb/1.3.23
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, mkdir '/home/ubuntu/.npm/mongodb/1.3.23'
npm ERR! not ok code 0

You can install mean.io in Cloud9 in the way mean.io describes on its website. Simply create a new NodeJS project then delete the default files it gives you and in the terminal run:
sudo npm install -g mean-cli
mean init yourNewApp
(from the mean.io website)
EDIT: That EACCES error is occuring due to root having ownership of the /home/ubuntu/.npm/mongodb folder. You can fix them by running:
sudo chown $(whoami). ~/.npm/*
I noticed in my own installation npm install didn't fully work after this fix due to some half installed packages. If you still continue to get errors after running the above command do the following in your project folder:
rm -rf ./node_modules
npm install

Related

when i am trying to install npm install gulp -D in cmd prompt there many errors displaying

node verison:v12.4.0
npm verison:6.13.4
laravel:5.8
Build failed with error code: 1
npm WARN The package popper.js is included as both a dev and production depende
cy.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.7 (node_modules\fs
vents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents
1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"
)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass#4.11.0 postinstall: node scripts/build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass#4.11.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional lo
ging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\CLOUD TIMON\AppData\Roaming\npm-cache_logs\2019-12-31T05
00_45_654Z-debug.log
first try to clean npm cache with :
npm cache clean --force
then delete node_modules folder completely, then again run npm install.
that should solve the problem.

npm install react-native-ibm-mobilefirst --save gives me error

react-native-ibm-mobilefirst#8.0.2018072413 postinstall D:\Call4Code\MyTestApp
\node_modules\react-native-ibm-mobilefirst
chmod +x scripts/postinstall.sh && ./scripts/postinstall.sh
'chmod' is not recognized as an internal or external command,
operable program or batch file.
npm WARN eslint-plugin-react-native#3.2.1 requires a peer of eslint#^3.17.0 || ^
4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.4 (node_modules\fse
vents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#
1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}
)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! react-native-ibm-mobilefirst#8.0.2018072413 postinstall: chmod +x scri
pts/postinstall.sh && ./scripts/postinstall.sh
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the react-native-ibm-mobilefirst#8.0.2018072413 postinstall s
cript.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\shalvi_kubal\AppData\Roaming\npm-cache_logs\2018-08-16T10
_34_10_364Z-debug.log
Currently there is a workaround that I used to install the react-native-ibm-mobilefirst plugin. You can create your react native project from macOS and then install the react-native-ibm-mobilefirst plugin from there, and then copy that project folder from macOS to windows. Then run 'npm install' inside the project folder and it will work fine.

Heroku Build Failed: "node_modules checked into source control"

I am deploying a site built upon MEAN stack on Heroku. While troubleshooting an issue I removed node_modules/ from my .gitignore file and ever since my app has been getting "Build failed" errors.
I readded node_modules/ to the file, but it seems the damage has been done as builds still fail.
One of the possible problems that is suggested in the log is:
"- node_modules checked into source control"
How do I go about undoing what I did?
-----> Deleting 1 files matching .slugignore patterns.
-----> Using set buildpack heroku/nodejs
-----> Node.js app detected
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
NPM_CONFIG_PRODUCTION=true
NODE_ENV=production
NODE_MODULES_CACHE=true
-----> Installing binaries
engines.node (package.json): 0.10.x
engines.npm (package.json): 2.x.x
Resolving node version 0.10.x via semver.io...
Downloading and installing node 0.10.41...
Resolving npm version 2.x.x via semver.io...
Downloading and installing npm 2.14.15 (replacing version 1.4.29)...
npm WARN deprecated This version of npm lacks support for important features,
npm WARN deprecated such as scoped packages, offered by the primary npm
npm WARN deprecated registry. Consider upgrading to at least npm#2, if not the
npm WARN deprecated latest stable version. To upgrade to npm#2, run:
npm WARN deprecated
npm WARN deprecated npm -g install npm#latest-2
npm WARN deprecated
npm WARN deprecated To upgrade to the latest stable version, run:
npm WARN deprecated
npm WARN deprecated npm -g install npm#latest
npm WARN deprecated
npm WARN deprecated (Depending on how Node.js was installed on your system, you
npm WARN deprecated may need to prefix the preceding commands with `sudo`, or if
npm WARN deprecated on Windows, run them from an Administrator prompt.)
npm WARN deprecated
npm WARN deprecated If you're running the version of npm bundled with
npm WARN deprecated Node.js 0.10 LTS, be aware that the next version of 0.10 LTS
npm WARN deprecated will be bundled with a version of npm#2, which has some small
npm WARN deprecated backwards-incompatible changes made to `npm run-script` and
npm WARN deprecated semver behavior.
-----> Restoring cache
Loading 2 from cacheDirectories (default):
- node_modules (exists - skipping)
- bower_components (not cached - skipping)
-----> Building dependencies
Prebuild detected (node_modules already exists)
Rebuilding any native modules
> bson#0.2.22 install /tmp/build_###########/node_modules/connect-mongo/node_modules/bson
> (node-gyp rebuild 2> builderror.log) || (exit 0)
make: Entering directory `/tmp/build_###########/node_modules/connect-mongo/node_modules/bson/build'
CXX(target) Release/obj.target/bson/ext/bson.o
SOLINK_MODULE(target) Release/obj.target/bson.node
COPY Release/bson.node
make: Leaving directory `/tmp/build_###########/node_modules/connect-mongo/node_modules/bson/build'
> bson#0.2.22 install /tmp/build_###########/node_modules/connect-mongo/node_modules/bson
> (node-gyp rebuild 2> builderror.log) || (exit 0)
make: Entering directory `/tmp/build_###########/node_modules/connect-mongo/node_modules/bson/build'
CXX(target) Release/obj.target/bson/ext/bson.o
SOLINK_MODULE(target) Release/obj.target/bson.node
COPY Release/bson.node
make: Leaving directory `/tmp/build_###########/node_modules/connect-mongo/node_modules/bson/build'
> bson#0.2.22 install /tmp/build_###########/node_modules/mongoose/node_modules/mongodb/node_modules/bson
> (node-gyp rebuild 2> builderror.log) || (exit 0)
make: Entering directory `/tmp/build_###########/node_modules/mongoose/node_modules/mongodb/node_modules/bson/build'
CXX(target) Release/obj.target/bson/ext/bson.o
SOLINK_MODULE(target) Release/obj.target/bson.node
COPY Release/bson.node
make: Leaving directory `/tmp/build_###########/node_modules/mongoose/node_modules/mongodb/node_modules/bson/build'
> phantomjs#1.9.19 install /tmp/build_###########/node_modules/phantomjs
> node install.js
PhantomJS not found on PATH
Downloading https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-linux-x86_64.tar.bz2
Saving to /tmp/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2
Receiving...
Received 12854K total.
Extracting tar contents (via spawned process)
Removing /tmp/build_###########/node_modules/phantomjs/lib/phantom
Copying extracted folder /tmp/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2-extract-1450118671217/phantomjs-1.9.8-linux-x86_64 -> /tmp/build_###########/node_modules/phantomjs/lib/phantom
Writing location.js file
Done. Phantomjs binary available at /tmp/build_###########/node_modules/phantomjs/lib/phantom/bin/phantomjs
> kerberos#0.0.11 install /tmp/build_###########/node_modules/kerberos
> (node-gyp rebuild 2> builderror.log) || (exit 0)
make: Entering directory `/tmp/build_###########/node_modules/kerberos/build'
CXX(target) Release/obj.target/kerberos/lib/kerberos.o
CXX(target) Release/obj.target/kerberos/lib/worker.o
CC(target) Release/obj.target/kerberos/lib/kerberosgss.o
CC(target) Release/obj.target/kerberos/lib/base64.o
CXX(target) Release/obj.target/kerberos/lib/kerberos_context.o
SOLINK_MODULE(target) Release/obj.target/kerberos.node
COPY Release/kerberos.node
make: Leaving directory `/tmp/build_###########/node_modules/kerberos/build'
> ws#0.4.32 install /tmp/build_###########/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
make: Entering directory `/tmp/build_###########/node_modules/ws/build'
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
SOLINK_MODULE(target) Release/obj.target/bufferutil.node
COPY Release/bufferutil.node
CXX(target) Release/obj.target/validation/src/validation.o
SOLINK_MODULE(target) Release/obj.target/validation.node
COPY Release/validation.node
make: Leaving directory `/tmp/build_###########/node_modules/ws/build'
> v8-profiler#5.2.12 preinstall /tmp/build_###########/node_modules/v8-profiler
>
> v8-profiler#5.2.12 install /tmp/build_###########/node_modules/v8-profiler
> node-pre-gyp install --fallback-to-build
sh: 1: node-pre-gyp: Permission denied
npm ERR! Linux 3.13.0-71-generic
npm ERR! argv "node" "/tmp/build_###########/.heroku/node/bin/npm" "rebuild"
npm ERR! node v0.10.41
npm ERR! npm v2.14.15
npm ERR! code ELIFECYCLE
npm ERR! v8-profiler#5.2.12 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 126
npm ERR!
npm ERR! Failed at the v8-profiler#5.2.12 install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! This is most likely a problem with the v8-profiler package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-pre-gyp install --fallback-to-build
npm ERR! You can get their info via:
npm ERR! npm owner ls v8-profiler
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /tmp/build_###########/npm-debug.log
-----> Build failed
We're sorry this build is failing! You can troubleshoot common issues here:
https://devcenter.heroku.com/articles/troubleshooting-node-deploys
Some possible problems:
- node_modules checked into source control
https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git
Love,
Heroku
! Push rejected, failed to compile Node.js app
Although you've re-added node_modules to your .gitignore, as you say, the damage has already been done. So you need to remove node_modules from your git repo. Try this:
git rm -r --cached node_modules
git commit -m 'Remove node_modules'
The first command recursively removes node_modules from the git repo without removing your local files, the second commits the removal.
You can then push your changes to Heroku.

Installing npm package acs fails due to incompatibility with tar#0.1.13

I'm trying to install the package acs through npm, but it fails and says it's not compatible with tar#0.1.13.
However when I run npm -g list it says that my installed version of tar is 2.1.1.
➜ ~ npm info tar version
2.1.1
But when I try to install acs it fails due to incompatibility with tar. See logs below:
➜ ~ npm install -g acs#1.0.25
> ws#0.4.32 install
/usr/local/lib/node_modules/acs/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
SOLINK_MODULE(target) Release/bufferutil.node
CXX(target) Release/obj.target/validation/src/validation.o
SOLINK_MODULE(target) Release/validation.node
npm ERR! Darwin 14.3.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "acs#1.0.25"
npm ERR! node v0.12.7
npm ERR! npm v2.13.1
npm ERR! code ENOTSUP
npm ERR! notsup Unsupported
npm ERR! notsup Not compatible with your version of node/npm: tar#0.1.13
npm ERR! notsup Required: {"node":"~0.5.9 || 0.6 || 0.7 || 0.8"}
npm ERR! notsup Actual: {"npm":"2.13.1","node":"0.12.7"}
npm ERR! Please include the following file with any support request:
npm ERR! /Users/sinkensabe/npm-debug.log
I cant figure out why it says that it is incompatible with tar#0.1.13 when this is not a version that seems to be installed on my unix system.
Any help is appreciated!
Got it to work, not sure why though.. Removed everything related to node and installed node with homebrew. Then installing acs worked without any problems.
Followed the instructions here to remove node: http://tinyurl.com/qxyax6y

Can't Install socket.io in Laravel Vagrant Homestead

Problem Can't install socket.io in laravel vagrant homestead. Bellow error was thrown.
Command npm install socket.io
Error
> ws#0.5.0 install /home/vagrant/Code/dota2/nodejs/node_modules/socket.io/node_m
odules/engine.io/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
make: Entering directory `/home/vagrant/Code/dota2/nodejs/node_modules/socket.io
/node_modules/engine.io/node_modules/ws/build'
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
SOLINK_MODULE(target) Release/obj.target/bufferutil.node
SOLINK_MODULE(target) Release/obj.target/bufferutil.node: Finished
COPY Release/bufferutil.node
CXX(target) Release/obj.target/validation/src/validation.o
SOLINK_MODULE(target) Release/obj.target/validation.node
SOLINK_MODULE(target) Release/obj.target/validation.node: Finished
COPY Release/validation.node
make: Leaving directory `/home/vagrant/Code/dota2/nodejs/node_modules/socket.io/
node_modules/engine.io/node_modules/ws/build'
npm ERR! Error: UNKNOWN, symlink '../ws/bin/wscat'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Linux 3.13.0-30-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! cwd /home/vagrant/Code/dota2/nodejs
npm ERR! node -v v0.10.32
npm ERR! npm -v 1.4.28
npm ERR! path ../ws/bin/wscat
npm ERR! code UNKNOWN
npm ERR! errno -1
npm ERR! not ok code 0
Vagrant/Homestead virtual machine can't handle binary links.
Instead of
npm install socket.io
use
npm install socket.io --no-bin-links

Resources