child-first-authority-fcc-project / vagrantbox

Vagrantfile and provisioning for child first authority project.
1 stars 4 forks source link

Grunt not installed #6

Closed pdotsani closed 8 years ago

pdotsani commented 8 years ago

After installation and running npm install && bower install in vagrant ssh, grunt cannot be found locally. I try to install manually, along with all dependencies, but I still can't get grunt up and running.

I'm assuming all these problems are connected to something I'm doing wrong during deploy...

dting commented 8 years ago

I can't replicate this issue and nothing has been changed? What's the error?

pdotsani commented 8 years ago
vagrant@dev:/vagrant/app$ grunt
grunt-cli: The grunt command line interface. (v0.1.13)

Fatal error: Unable to find local grunt.

If you're seeing this message, either a Gruntfile wasn't found or grunt
hasn't been installed locally to your project. For more information about
installing and configuring grunt, please see the Getting Started guide:

http://gruntjs.com/getting-started

Keep in mind, this is after a full re-deploy of the vagrantbox and my cloned repo. Running projects locally is fine.

dting commented 8 years ago

Check the vagrant/app/node_packages to see if grunt is installed.

pdotsani commented 8 years ago
vagrant@dev:/vagrant/app$ npm list -g --depth=0
/home/vagrant/n/lib
├── bower@1.7.7
├── generator-angular-fullstack@3.5.0
├── grunt-cli@0.1.13
├── npm@3.8.2
├── npm-check-updates@2.6.1
└── yo@1.7.0
vagrant@dev:/vagrant/app$ npm list --depth=0
app@0.0.0 /vagrant/app
├── UNMET DEPENDENCY body-parser@~1.14.2
├── UNMET DEPENDENCY composable-middleware@^0.3.0
├── UNMET DEPENDENCY compression@~1.6.1
├── UNMET DEPENDENCY connect-mongo@^1.1.0
├── UNMET DEPENDENCY cookie-parser@~1.4.1
├── UNMET DEPENDENCY ejs@~2.4.1
├── UNMET DEPENDENCY errorhandler@~1.4.3
├── UNMET DEPENDENCY express@~4.13.4
├── UNMET DEPENDENCY express-jwt@^3.0.0
├── UNMET DEPENDENCY express-session@~1.13.0
├── UNMET DEPENDENCY jsonwebtoken@^5.0.0
├── UNMET DEPENDENCY lodash@~4.5.1
├── UNMET DEPENDENCY method-override@~2.3.5
├── UNMET DEPENDENCY mongoose@~4.4.2
├── UNMET DEPENDENCY morgan@~1.6.1
├── UNMET DEPENDENCY passport@~0.3.2
├── UNMET DEPENDENCY passport-google-oauth@latest
├── UNMET DEPENDENCY passport-local@~1.0.0
└── UNMET DEPENDENCY serve-favicon@~2.3.0

npm ERR! missing: body-parser@~1.14.2, required by app@0.0.0
npm ERR! missing: composable-middleware@^0.3.0, required by app@0.0.0
npm ERR! missing: compression@~1.6.1, required by app@0.0.0
npm ERR! missing: connect-mongo@^1.1.0, required by app@0.0.0
npm ERR! missing: cookie-parser@~1.4.1, required by app@0.0.0
npm ERR! missing: ejs@~2.4.1, required by app@0.0.0
npm ERR! missing: errorhandler@~1.4.3, required by app@0.0.0
npm ERR! missing: express@~4.13.4, required by app@0.0.0
npm ERR! missing: express-jwt@^3.0.0, required by app@0.0.0
npm ERR! missing: express-session@~1.13.0, required by app@0.0.0
npm ERR! missing: jsonwebtoken@^5.0.0, required by app@0.0.0
npm ERR! missing: lodash@~4.5.1, required by app@0.0.0
npm ERR! missing: method-override@~2.3.5, required by app@0.0.0
npm ERR! missing: mongoose@~4.4.2, required by app@0.0.0
npm ERR! missing: morgan@~1.6.1, required by app@0.0.0
npm ERR! missing: passport@~0.3.2, required by app@0.0.0
npm ERR! missing: passport-local@~1.0.0, required by app@0.0.0
npm ERR! missing: serve-favicon@~2.3.0, required by app@0.0.0
npm ERR! missing: passport-google-oauth@latest, required by app@0.0.0

because of the unmet dependencies above, I ran vagrant@dev:/vagrant/app$ npm install body-parser@~1.14.2 composable-middleware@^0.3.0 compression@~1.6.1 connect-mongo@^1.1.0 cookie-parser@~1.4.1 ejs@~2.4.1 errorhandler@~1.4.3 express@~4.13.4 express-jwt@^3.0.0 express-session@~1.13.0 jsonwebtoken@^5.0.0 lodash@~4.5.1 method-override@~2.3.5 mongoose@~4.4.2 morgan@~1.6.1 passport@~0.3.2 passport-google-oauth@latest passport-local@~1.0.0 serve-favicon@~2.3.0

Everything passed with no errors, but when I tried to run grunt again, got the same error as in the comment I made above.

pdotsani commented 8 years ago

Just ran vagrant@dev:/vagrant/app$ npm install grunt with no errors.
Tried to run grunt, and got the following error, which leads me back to where I got stuck in the first place...

vagrant@dev:/vagrant/app$ grunt
Loading "Gruntfile.js" tasks...ERROR
>> Error: Cannot find module 'jit-grunt'
Warning: Task "default" not found. Use --force to continue.

Aborted due to warnings.

This just leads me down a path of installing dependencies.

dting commented 8 years ago

Okay I did a clean install and it seems like this version of npm has some sort of issue where packages are being placed into a .staging directory in the node_modules folder but never getting installed. I'm guessing something is up with the new version of npm but don't have time to investigate this issue right now.

pdotsani commented 8 years ago

Good to know. Should I hold off on working on the project until this is fixed? I was thinking of working from my local machine but I'm not sure if that would mess up the repo.

Is there anything I can do to help out?

dting commented 8 years ago

This isn't really an issue with the actual project. You could try downgrading npm on the vm. I took a quick look online for a solution but I haven't found anything regarding this specific problem yet. Let me know if you figure it out.

dting commented 8 years ago

Looks like npm is running out of memory.

145064 verbose stack Error: spawn ENOMEM
145064 verbose stack     at exports._errnoException (util.js:746:11)
145064 verbose stack     at ChildProcess.spawn (child_process.js:1162:11)
145064 verbose stack     at exports.spawn (child_process.js:995:9)
145064 verbose stack     at spawn (/home/vagrant/n/lib/node_modules/npm/lib/utils/spawn.js:7:13)
145064 verbose stack     at runCmd_ (/home/vagrant/n/lib/node_modules/npm/lib/utils/lifecycle.js:231:14)
145064 verbose stack     at runCmd (/home/vagrant/n/lib/node_modules/npm/lib/utils/lifecycle.js:190:5)
145064 verbose stack     at runPackageLifecycle (/home/vagrant/n/lib/node_modules/npm/lib/utils/lifecycle.js:154:3)
145064 verbose stack     at Array.<anonymous> (/home/vagrant/n/lib/node_modules/npm/node_modules/slide/lib/bind-actor.js:15:8)
145064 verbose stack     at LOOP (/home/vagrant/n/lib/node_modules/npm/node_modules/slide/lib/chain.js:15:14)
145064 verbose stack     at chain (/home/vagrant/n/lib/node_modules/npm/node_modules/slide/lib/chain.js:20:5)
145065 verbose cwd /vagrant/app
145066 error Linux 3.13.0-76-generic
145067 error argv "node" "/home/vagrant/n/bin/npm" "install" "--verbose"
145068 error node v0.12.7
145069 error npm  v3.8.2
145070 error code ENOMEM
145071 error errno ENOMEM
145072 error syscall spawn
145073 error spawn ENOMEM
145074 error If you need help, you may report this error at:
145074 error     <https://github.com/npm/npm/issues>
145075 verbose exit [ 1, true ]
pdotsani commented 8 years ago

Ok. Everything's working now in terms of grunt, now this error pops up:

Uncaught SyntaxError: Unexpected token e        angular.js:4576

Error occurs in browser after I run the app via grunt serve

grunt clears with no errors, and the same with grunt serve, I tried rebuilding several times with no luck...

dting commented 8 years ago

Hmm, not sure what is causing that. You probably need to look at the stack trace to see what part of the code is throwing.

pdotsani commented 8 years ago

Ok I'll try that. Can you do a npm list -g --depth=0 on your machine so I can have something to compare to? I'm thinking it's my version of node or npm or some global package that's triggering this. I know it's being run on a vm, but wouldn't hurt to try emulating a working environment.

dting commented 8 years ago

Your problem looks to be an error in your client code in your repository.

vagrant@dev:/vagrant/app$ npm list -g --depth=0
/home/vagrant/n/lib
├── bower@1.7.7
├── generator-angular-fullstack@3.5.0
├── grunt-cli@0.1.13
├── npm@3.8.2
├── npm-check-updates@2.6.1
└── yo@1.7.0

vagrant@dev:/vagrant/app$ node --version
v0.12.7
vagrant@dev:/vagrant/app$ npm --version
3.8.2
vagrant@dev:/vagrant/app$ bower list
bower check-new     Checking for new versions of the project dependencies...
app#0.0.0 /vagrant/app
├── angular#1.5.2 (1.5.3-build.4682+sha.7e5e66f available)
├─┬ angular-animate#1.5.2 (1.5.3-build.4682+sha.7e5e66f available)
│ └── angular#1.5.2 (latest is 1.5.3-build.4682+sha.7e5e66f)
├─┬ angular-bootstrap#1.2.5
│ └── angular#1.5.2 (1.5.3-build.4682+sha.7e5e66f available)
├─┬ angular-cookies#1.5.2 (1.5.3-build.4682+sha.7e5e66f available)
│ └── angular#1.5.2
├─┬ angular-messages#1.5.2 (1.5.3-build.4682+sha.7e5e66f available)
│ └── angular#1.5.2
├─┬ angular-mocks#1.5.2 (1.5.3-build.4682+sha.7e5e66f available)
│ └── angular#1.5.2
├─┬ angular-resource#1.5.2 (1.5.3-build.4682+sha.7e5e66f available)
│ └── angular#1.5.2
├─┬ angular-sanitize#1.5.2 (1.5.3-build.4682+sha.7e5e66f available)
│ └── angular#1.5.2
├─┬ angular-scenario#1.5.2 (1.5.3-build.4682+sha.7e5e66f available)
│ └── angular#1.5.2
├─┬ angular-toastr#1.7.0
│ └── angular#1.5.2 (1.5.3-build.4682+sha.7e5e66f available)
├─┬ angular-ui-grid#3.1.1
│ └── angular#1.5.2 incompatible with >=1.2.16 1.4.x (1.4.10 available, latest is 1.5.3-build.4682+sha.7e5e66f)
├─┬ angular-ui-router#0.2.18
│ └── angular#1.5.2 (1.5.3-build.4682+sha.7e5e66f available)
├─┬ bootstrap#3.3.6 (latest is 4.0.0-alpha.2)
│ └── jquery#2.2.2 (latest is 3.0.0-beta1)
├─┬ bootstrap-sass-official#3.3.6
│ └── jquery#2.2.2 (3.0.0-beta1 available)
├── es5-shim#4.5.7
├── font-awesome#4.5.0
├── highcharts#4.2.3
├── highcharts-ng#0.0.11
├── json3#3.3.2
├── lodash#4.5.1 (4.5.3-npm-packages available, latest is 4.6.1)
├─┬ matchmedia-ng#1.0.8
│ └── matchmedia#0.2.0 (latest is 0.3.0)
├─┬ ng-file-upload#12.0.4
│ └── angular#1.5.2 (1.5.3-build.4682+sha.7e5e66f available)
├── pdfjs-dist#1.4.141
├── pdfmake#0.1.20
└─┬ ui-select#0.14.9 (latest is 0.16.0)
  └── angular#1.5.2 (1.5.3-build.4682+sha.7e5e66f available)
vagrant@dev:/vagrant/app$
pdotsani commented 8 years ago

I'm not sure how that could be. I'm working from a fresh clone of my fork using clean passing code. I'm gunna give it a go again and hopefully figure something out.

pdotsani commented 8 years ago

Ok finally got it working! Cleared the cache and browser history on chrome and everything's working fine now.