I’ve just tried getting ionic working on my work mac and it doesn’t seem to play ball. Works fine for me on my personal mac.
I’m getting the following error when trying to run ionic serve. I’m not sure how to fix it.
I’ve literally just downloaded ionic by following the instruction on the getting started page.
I can build and emulate for ios.
$ ionic serve
Running serve task…
/usr/local/lib/node_modules/ionic/lib/ionic/serve.js:86
app.use(connect.static(‘www’))
^
TypeError: Object function createServer() {
function app(req, res, next){ app.handle(req, res, next); }
merge(app, proto);
merge(app, EventEmitter.prototype);
app.route = ‘/’;
app.stack = [];
return app;
} has no method 'static’
at Object.IonicServeTask._start (/usr/local/lib/node_modules/ionic/lib/ionic/serve.js:86:25)
at Object.IonicServeTask.run (/usr/local/lib/node_modules/ionic/lib/ionic/serve.js:35:8)
at Object.Ionic.run (/usr/local/lib/node_modules/ionic/lib/ionic.js:192:13)
at Object. (/usr/local/lib/node_modules/ionic/bin/ionic:10:7)
at Module._compile (module.js:456:26)
at Object.Module._extensions…js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
Thanks for the reply. Yes I did run the npm install. (I just ran it again to check), but I get the same error.
Do you mean the package.json within the app folder?
If so
{
“name”: “ionic-project”,
“version”: “1.0.0”,
“description”: “An Ionic project”,
“dependencies”: {
“gulp”: “^3.5.6”,
“gulp-sass”: “^0.7.1”,
“gulp-concat”: “^2.2.0”,
“gulp-minify-css”: “^0.3.0”,
“gulp-rename”: “^1.2.0”
},
“devDependencies”: {
“bower”: “^1.3.3”,
“gulp-util”: “^2.2.14”,
“shelljs”: “^0.3.0”
}
}
Tried uninstalling iconic and cordova. Using
$ sudo npm cache clear
$ sudo npm uninstall ionic
$ sudo npm install ionic -g
But still get the same error
Just installed ionic for the first time today via npm and I have the exact same problem.
/usr/local/share/npm/lib/node_modules/ionic/lib/ionic/serve.js:86
app.use(connect.static('www'))
^
TypeError: Object function createServer() {
function app(req, res, next){ app.handle(req, res, next); }
merge(app, proto);
merge(app, EventEmitter.prototype);
app.route = '/';
app.stack = [];
return app;
} has no method 'static'
at Object.IonicServeTask._start (/usr/local/share/npm/lib/node_modules/ionic/lib/ionic/serve.js:86:25)
at Object.IonicServeTask.run (/usr/local/share/npm/lib/node_modules/ionic/lib/ionic/serve.js:28:8)
at Object.Ionic.run (/usr/local/share/npm/lib/node_modules/ionic/lib/ionic.js:337:13)
at Object.<anonymous> (/usr/local/share/npm/lib/node_modules/ionic/bin/ionic:10:7)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)