折腾:
期间,需要去先去安装gulp,然后再去使用。
以为是bower去装gulp,结果出错:
然后用npm去安装gulp:
➜ dist npm install -g gulp npm ERR! tar.unpack untar error /Users/crifan/.npm/gulp/3.9.1/package.tgz npm ERR! Darwin 15.6.0 npm ERR! argv “/usr/local/bin/node” “/usr/local/bin/npm” “install” “-g” “gulp” npm ERR! node v4.4.7 npm ERR! npm v2.15.8 npm ERR! path /usr/local/lib/node_modules/gulp npm ERR! code EACCES npm ERR! errno -13 npm ERR! syscall mkdir npm ERR! Error: EACCES: permission denied, mkdir ‘/usr/local/lib/node_modules/gulp’ npm ERR! at Error (native) npm ERR! { [Error: EACCES: permission denied, mkdir ‘/usr/local/lib/node_modules/gulp’] npm ERR! errno: -13, npm ERR! code: ‘EACCES’, npm ERR! syscall: ‘mkdir’, npm ERR! path: ‘/usr/local/lib/node_modules/gulp’, npm ERR! fstream_type: ‘Directory’, npm ERR! fstream_path: ‘/usr/local/lib/node_modules/gulp’, npm ERR! fstream_class: ‘DirWriter’, npm ERR! fstream_stack: npm ERR! [ ‘/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:35:25’, npm ERR! ‘/usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:47:53’, npm ERR! ‘FSReqWrap.oncomplete (fs.js:82:15)’ ] } npm ERR! npm ERR! Please try running this command again as root/Administrator. npm ERR! Please include the following file with any support request: npm ERR! /Users/crifan/dev/dev_root/daryun/JianDaoWeixin/sourcecode/UIDemo/JiandaoWorkbench/F7/bower_components/Framework7/dist/npm-debug.log |
结果需要管理员权限,所以再去:
➜ dist sudo npm install -g gulp Password: npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use ‘npm ls graceful-fs’ to find it in the tree. npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue npm WARN deprecated [email protected]: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0. npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use ‘npm ls graceful-fs’ to find it in the tree. /usr/local/bin/gulp -> /usr/local/lib/node_modules/gulp/bin/gulp.js [email protected] /usr/local/lib/node_modules/gulp ├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected]) ├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]) ├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]) └── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]) |
即可。
然后去试试:
gulp server
结果报错:
Local gulp not found in ~/dev/dev_root/daryun/JianDaoWeixin/sourcecode/UIDemo/JiandaoWorkbench/F7/bower_components/Framework7 [15:32:41] Try running: npm install gulp |
搜:
Local gulp not found in Try running npm install gulp
javascript – Why do we need to install gulp globally and locally? – Stack Overflow
linux – No local gulp install found even after installing npm install -g gulp – Stack Overflow
gulp/getting-started.md at master · gulpjs/gulp
看到本地文件夹中多了:
node_modules
➜ Framework7 ll total 192 -rw-r–r– 1 crifan staff 67K 8 4 11:48 CHANGELOG.md -rw-r–r– 1 crifan staff 1.1K 8 4 11:48 LICENSE -rw-r–r– 1 crifan staff 3.6K 8 4 11:48 README.md -rw-r–r– 1 crifan staff 814B 8 4 11:48 bower.json -rw-r–r– 1 crifan staff 879B 8 4 11:48 composer.json drwxr-xr-x 10 crifan staff 340B 8 5 15:15 dist drwxr-xr-x 7 crifan staff 238B 8 4 11:48 examples -rw-r–r– 1 crifan staff 3.9K 8 4 11:48 index.html drwxr-xr-x 82 crifan staff 2.7K 8 4 11:48 kitchen-sink-ios drwxr-xr-x 88 crifan staff 2.9K 8 4 11:48 kitchen-sink-material -rw-r–r– 1 crifan staff 7.7K 8 4 11:48 modules.json drwxr-xr-x 4 crifan staff 136B 8 5 15:39 node_modules drwxr-xr-x 7 crifan staff 238B 8 4 11:48 src ➜ Framework7 ll node_modules total 0 drwxr-xr-x 12 crifan staff 408B 8 5 15:39 gulp ➜ Framework7 ll node_modules/gulp/ total 56 -rw-r–r– 1 crifan staff 5.6K 2 1 2016 CHANGELOG.md -rw-r–r– 1 crifan staff 1.1K 2 1 2016 LICENSE -rw-r–r– 1 crifan staff 3.9K 2 9 02:32 README.md drwxr-xr-x 3 crifan staff 102B 2 1 2016 bin drwxr-xr-x 7 crifan staff 238B 8 5 15:38 completion -rw-r–r– 1 crifan staff 2.0K 2 9 02:50 gulp.1 -rw-r–r– 1 crifan staff 1.5K 2 1 2016 index.js drwxr-xr-x 4 crifan staff 136B 8 5 15:38 lib drwxr-xr-x 16 crifan staff 544B 8 5 15:39 node_modules -rw-r–r– 1 crifan staff 2.7K 8 5 15:38 package.json |
然后去运行,结果出错:
➜ Framework7 gulp server [15:43:38] No gulpfile found |
转载请注明:在路上 » [记录]安装和使用gulp