我已经安装了Node的LTS版本。但是无法运行我的第一个应用程序。 我只是按照此链接“https://ionicframework.com/docs/intro/installation/”进行安装。
已经验证node version
和Prakashs-MacBook-Pro-4:~ prakash$ sudo ionic start MyIonicProject tutorial
Password:
✔ Creating directory ./MyIonicProject - done!
✔ Downloading and extracting tutorial starter - done!
? Would you like to integrate your new app with Cordova to target native iOS and
Android? Yes
✔ Personalizing ionic.config.json and package.json - done!
> ionic integrations enable cordova --quiet
✔ Downloading integration cordova - done!
✔ Copying integrations files to project - done!
[OK] Added cordova integration!
Installing dependencies may take several minutes.
✨ IONIC DEVAPP ✨
Speed up development with the Ionic DevApp, our fast, on-device testing mobile app
- Test on iOS and Android without Native SDKs
- LiveReload for instant style and JS updates
> npm i
✖ Running command - failed!
[ERROR] An error occurred while running npm i (exit code 1):
> fsevents@1.1.3 install
/Users/prakash/MyIonicProject/node_modules/fsevents
> node install
[fsevents] Success:
"/Users/prakash/MyIonicProject/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node"
already installed
Pass --update-binary to reinstall or --build-from-source to recompile
> node-sass@4.7.2 install
/Users/prakash/MyIonicProject/node_modules/node-sass
> node scripts/install.js
Unable to save binary
/Users/prakash/MyIonicProject/node_modules/node-sass/vendor/darwin-x64-57
: { Error: EACCES: permission denied, mkdir
'/Users/prakash/MyIonicProject/node_modules/node-sass/vendor'
at Object.fs.mkdirSync (fs.js:885:18)
at sync
(/Users/prakash/MyIonicProject/node_modules/mkdirp/index.js:71:13)
at Function.sync
(/Users/prakash/MyIonicProject/node_modules/mkdirp/index.js:77:24)
at checkAndDownloadBinary
(/Users/prakash/MyIonicProject/node_modules/node-sass/scripts/install.js:111:11)
at Object.<anonymous>
(/Users/prakash/MyIonicProject/node_modules/node-sass/scripts/install.js:154:1)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
errno: -13,
code: 'EACCES',
syscall: 'mkdir',
path: '/Users/prakash/MyIonicProject/node_modules/node-sass/vendor' }
> uglifyjs-webpack-plugin@0.4.6 postinstall
/Users/prakash/MyIonicProject/node_modules/uglifyjs-webpack-plugin
> node lib/post_install.js
> node-sass@4.7.2 postinstall
/Users/prakash/MyIonicProject/node_modules/node-sass
> node scripts/build.js
Building: /usr/local/bin/node
/Users/prakash/MyIonicProject/node_modules/node-gyp/bin/node-gyp.js
rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags=
--libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ '/usr/local/bin/node',
gyp verb cli
'/Users/prakash/MyIonicProject/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli 'rebuild',
gyp verb cli '--verbose',
gyp verb cli '--libsass_ext=',
gyp verb cli '--libsass_cflags=',
gyp verb cli '--libsass_ldflags=',
gyp verb cli '--libsass_library=' ]
gyp info using node-gyp@3.6.2
gyp info using node@8.11.1 | darwin | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the
PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed at getNotFoundError
(/Users/prakash/MyIonicProject/node_modules/which/which.js:13:12)
gyp verb `which` failed at F
(/Users/prakash/MyIonicProject/node_modules/which/which.js:68:19)
gyp verb `which` failed at E
(/Users/prakash/MyIonicProject/node_modules/which/which.js:80:29)
gyp verb `which` failed at
/Users/prakash/MyIonicProject/node_modules/which/which.js:89:16
gyp verb `which` failed at
/Users/prakash/MyIonicProject/node_modules/isexe/index.js:42:5
gyp verb `which` failed at
/Users/prakash/MyIonicProject/node_modules/isexe/mode.js:8:5
gyp verb `which` failed at FSReqWrap.oncomplete (fs.js:152:21)
gyp verb `which` failed python2 { Error: not found: python2
gyp verb `which` failed at getNotFoundError
(/Users/prakash/MyIonicProject/node_modules/which/which.js:13:12)
gyp verb `which` failed at F
(/Users/prakash/MyIonicProject/node_modules/which/which.js:68:19)
gyp verb `which` failed at E
(/Users/prakash/MyIonicProject/node_modules/which/which.js:80:29)
gyp verb `which` failed at
/Users/prakash/MyIonicProject/node_modules/which/which.js:89:16
gyp verb `which` failed at
/Users/prakash/MyIonicProject/node_modules/isexe/index.js:42:5
gyp verb `which` failed at
/Users/prakash/MyIonicProject/node_modules/isexe/mode.js:8:5
gyp verb `which` failed at FSReqWrap.oncomplete (fs.js:152:21)
gyp verb `which` failed stack: 'Error: not found: python2\n at
getNotFoundError
(/Users/prakash/MyIonicProject/node_modules/which/which.js:13:12)\n
at F (/Users/prakash/MyIonicProject/node_modules/which/which.js:68:19)\n
at E
(/Users/prakash/MyIonicProject/node_modules/which/which.js:80:29)\n
at /Users/prakash/MyIonicProject/node_modules/which/which.js:89:16\n
at /Users/prakash/MyIonicProject/node_modules/isexe/index.js:42:5\n
at /Users/prakash/MyIonicProject/node_modules/isexe/mode.js:8:5\n at
FSReqWrap.oncomplete (fs.js:152:21)',
gyp verb `which` failed code: 'ENOENT' }
gyp verb check python checking for Python executable "python" in the
PATH
gyp verb `which` succeeded python /usr/bin/python
gyp verb check python version `/usr/bin/python -c "import platform;
print(platform.python_version());"` returned: "2.7.10\n"
gyp verb get node dir no --target version specified, falling back to
host node version: 8.11.1
gyp verb command install [ '8.11.1' ]
gyp verb install input version string "8.11.1"
gyp verb install installing version: 8.11.1
gyp verb install --ensure was passed, so won't reinstall if already
installed
gyp verb install version is already installed, need to check
"installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: 8.11.1
gyp verb build dir attempting to create "build" dir:
/Users/prakash/MyIonicProject/node_modules/node-sass/build
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir
'/Users/prakash/MyIonicProject/node_modules/node-sass/build'
gyp ERR! System Darwin 17.3.0
gyp ERR! command "/usr/local/bin/node"
"/Users/prakash/MyIonicProject/node_modules/node-gyp/bin/node-gyp.js"
"rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags="
"--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /Users/prakash/MyIonicProject/node_modules/node-sass
gyp ERR! node -v v8.11.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed with error code: 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.7.2 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.7.2 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely
additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!
/Users/prakash/.npm/_logs/2018-04-02T13_38_21_394Z-debug.log
......现在一切都很好。
错误日志:
<?php
/**
* Capture user login and add it as timestamp in user meta data
*
*/
function user_last_login( $user_login, $user ) {
update_user_meta( $user->ID, 'last_login', time() );
}
add_action( 'wp_login', 'user_last_login', 10, 2 );
function wpb_lastlogin() {
$last_login = get_the_author_meta('last_login');
$the_login_date = human_time_diff($last_login);
return $the_login_date;
}
add_shortcode('lastlogin','wpb_lastlogin');
?>
<?php echo 'Last seen: '. do_shortcode('[lastlogin]') .' ago'; ?>
答案 0 :(得分:0)
由于权限错误而失败,请尝试
sudo npm i