So I'm starting to work with Grunt and NPM for a project. I was able to set up and run Grunt successfully. Then if I try to install a new plugin with NPM, I get this error:
module.js:338
throw err;
^
Error: Cannot find module './config/core.js'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at /usr/local/Cellar/node/0.10.20/lib/node_modules/npm/lib/npm.js:19:15
at Object.<anonymous> (/usr/local/Cellar/node/0.10.20/lib/node_modules/npm/lib/npm.js:467:3)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
I then search around and see suggestions to do a npm install again. Or even an npm update. The problem is I get the same error! I even try doing things globally and in the root folder and I still get the error :(
Would greatly appreciate any help on my issue
Here is my Gruntfile.js
module.exports = function(grunt) {
require('jit-grunt')(grunt);
grunt.initConfig({
less: {
development: {
options: {
compress: true,
yuicompress: true,
optimization: 2
},
files: {
"css/style.css": "less/style.less" // destination file and source file
}
}
},
watch: {
styles: {
files: ['less/**/*.less'], // which files to watch
tasks: ['less'],
options: {
nospawn: true
}
}
}
});
grunt.registerTask('default', ['less', 'watch']);
};
Here is my package.json
{
"name": "showtime",
"version": "0.0.1",
"main": "Gruntfile.js",
"dependencies": {
"grunt": "~0.4.5"
},
"devDependencies": {
"grunt": "~0.4.5",
"grunt-contrib-less": "~0.11.0",
"grunt-contrib-watch": "~0.6.1",
"jit-grunt": "~0.7.0"
},
"author": "Amie",
"license": "BSD-2-Clause"
}