我正在学习ionic2。我认为示例应用程序是一个很好的起点,但不幸的是,我无法让它工作。它抱怨缺少模块。请看输出:
lola@ubuntu:~/pj/ionic-conference-app$ ionic serve
Running 'serve:before' gulp task before serve
[08:53:57] Starting 'sass'...
[08:53:57] Starting 'html'...
[08:53:57] Starting 'fonts'...
[08:53:57] Starting 'scripts'...
[08:53:57] Finished 'scripts' after 63 ms
[08:53:57] Finished 'html' after 115 ms
[08:53:57] Finished 'fonts' after 114 ms
[08:53:58] Finished 'sass' after 888 ms
[08:53:58] Starting 'watch'...
✗ Caught exception:
Error: Cannot find module 'babelify' from '/home/lola/pj/ionic-conference-app'
at /home/lola/pj/ionic-conference-app/node_modules/ionic-gulp-browserify-es2015/node_modules/browserify/node_modules/resolve/lib/async.js:46:17
at process (/home/lola/pj/ionic-conference-app/node_modules/ionic-gulp-browserify-es2015/node_modules/browserify/node_modules/resolve/lib/async.js:173:43)
at ondir (/home/lola/pj/ionic-conference-app/node_modules/ionic-gulp-browserify-es2015/node_modules/browserify/node_modules/resolve/lib/async.js:188:17)
at load (/home/lola/pj/ionic-conference-app/node_modules/ionic-gulp-browserify-es2015/node_modules/browserify/node_modules/resolve/lib/async.js:69:43)
at onex (/home/lola/pj/ionic-conference-app/node_modules/ionic-gulp-browserify-es2015/node_modules/browserify/node_modules/resolve/lib/async.js:92:31)
at /home/lola/pj/ionic-conference-app/node_modules/ionic-gulp-browserify-es2015/node_modules/browserify/node_modules/resolve/lib/async.js:22:47
at FSReqWrap.oncomplete (fs.js:82:15)
Mind letting us know? https://github.com/driftyco/ionic-cli/issues
$ionic info
Your system information:
Cordova CLI: 6.1.1
Ionic Version: 2.0.0-beta.3
Ionic CLI Version: 2.0.0-beta.22
Ionic App Lib Version: 2.0.0-beta.12
OS:
Node Version: v4.4.2
任何人都可以帮助我吗?
答案 0 :(得分:0)
很可能,您需要更新NPM,其中包括babelify依赖项。运行npm -v
检查您的NPM版本,它应该是v3.x.运行sudo npm install -g npm
来更新npm。你应该好好去。
答案 1 :(得分:0)
项目根目录中的npm install
只为我工作。