2017-09-24 32 views
1

我试图启动以下步骤论文我的第一个项目离子:Ionic framework get started page类型错误:msg.trim不离子项目的功能

但是,当我在终端ionic serve正在写(步骤3)我有这个错误消息,即使我运行在http://localhost:8100开发服务器(我的应用程序正在运行,但我仍然有此错误消息):

TypeError: msg.trim is not a function 
at Logger.log (/usr/local/lib/node_modules/ionic/node_modules/@ionic/cli-utils/lib/utils/logger.js:78:21) 
at Logger.error (/usr/local/lib/node_modules/ionic/node_modules/@ionic/cli-utils/lib/utils/logger.js:35:14) 
at Object.<anonymous> (/usr/local/lib/node_modules/ionic/dist/index.js:261:22) 
at throw (native) 
at rejected (/usr/local/lib/node_modules/ionic/node_modules/tslib/tslib.js:94:69) 
当我写命令sudo离子开始对myApp标签我有这个安装过程中

而且:Running command - failed! [ERROR] An error occurred while running npm install (exit code 1):

在终端(我在MacOS)

完全错误消息:

npm WARN deprecated [email protected]: babili has been renamed to 
    babel-minify. Please update to babel-minify 
    npm WARN deprecated [email protected]: babili has been renamed 
    to babel-minify. Please update to babel-preset-minify 
    npm WARN deprecated [email protected]: Please update to the latest 
    object-keys 

    > [email protected] install 
    /Users/emilio/TestIonic/myApp/node_modules/fsevents 
    > node install 

    [fsevents] Success: 
    "/Users/emilio/TestIonic/myApp/node_modules/fsevents/lib/binding/Release/node-v48-darwin-x64/fse.node" 
    already installed 
    Pass --update-binary to reinstall or --build-from-source to recompile 

    > [email protected] install 
    /Users/emilio/TestIonic/myApp/node_modules/node-sass 
    > node scripts/install.js 

    Unable to save binary 
    /Users/emilio/TestIonic/myApp/node_modules/node-sass/vendor/darwin-x64-48 
    : { Error: EACCES: permission denied, mkdir 
    '/Users/emilio/TestIonic/myApp/node_modules/node-sass/vendor' 
     at Error (native) 
     at Object.fs.mkdirSync (fs.js:924:18) 
     at sync 
    (/Users/emilio/TestIonic/myApp/node_modules/mkdirp/index.js:71:13) 
     at Function.sync 
    (/Users/emilio/TestIonic/myApp/node_modules/mkdirp/index.js:77:24) 
     at checkAndDownloadBinary 
    (/Users/emilio/TestIonic/myApp/node_modules/node-sass/scripts/install.js:111:11) 
     at Object.<anonymous> 
    (/Users/emilio/TestIonic/myApp/node_modules/node-sass/scripts/install.js:154:1) 
     at Module._compile (module.js:570:32) 
     at Object.Module._extensions..js (module.js:579:10) 
     at Module.load (module.js:487:32) 
     at tryModuleLoad (module.js:446:12) 
     errno: -13, 
     code: 'EACCES', 
     syscall: 'mkdir', 
     path: '/Users/emilio/TestIonic/myApp/node_modules/node-sass/vendor' } 

    > [email protected] postinstall 
    /Users/emilio/TestIonic/myApp/node_modules/uglifyjs-webpack-plugin 
    > node lib/post_install.js 


    > [email protected] postinstall 
    /Users/emilio/TestIonic/myApp/node_modules/node-sass 
    > node scripts/build.js 

    Building: /usr/local/bin/node 
    /Users/emilio/TestIonic/myApp/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/emilio/TestIonic/myApp/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 [email protected] 
    gyp info using [email protected] | 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/emilio/TestIonic/myApp/node_modules/which/which.js:13:12) 
    gyp verb `which` failed  at F 
    (/Users/emilio/TestIonic/myApp/node_modules/which/which.js:68:19) 
    gyp verb `which` failed  at E 
    (/Users/emilio/TestIonic/myApp/node_modules/which/which.js:80:29) 
    gyp verb `which` failed  at 
    /Users/emilio/TestIonic/myApp/node_modules/which/which.js:89:16 
    gyp verb `which` failed  at 
    /Users/emilio/TestIonic/myApp/node_modules/isexe/index.js:42:5 
    gyp verb `which` failed  at 
    /Users/emilio/TestIonic/myApp/node_modules/isexe/mode.js:8:5 
    gyp verb `which` failed  at FSReqWrap.oncomplete (fs.js:123:15) 
    gyp verb `which` failed python2 { Error: not found: python2 
    gyp verb `which` failed  at getNotFoundError 
    (/Users/emilio/TestIonic/myApp/node_modules/which/which.js:13:12) 
    gyp verb `which` failed  at F 
    (/Users/emilio/TestIonic/myApp/node_modules/which/which.js:68:19) 
    gyp verb `which` failed  at E 
    (/Users/emilio/TestIonic/myApp/node_modules/which/which.js:80:29) 
    gyp verb `which` failed  at 
    /Users/emilio/TestIonic/myApp/node_modules/which/which.js:89:16 
    gyp verb `which` failed  at 
    /Users/emilio/TestIonic/myApp/node_modules/isexe/index.js:42:5 
    gyp verb `which` failed  at 
    /Users/emilio/TestIonic/myApp/node_modules/isexe/mode.js:8:5 
    gyp verb `which` failed  at FSReqWrap.oncomplete (fs.js:123:15) 
    gyp verb `which` failed stack: 'Error: not found: python2\n at 
    getNotFoundError 
    (/Users/emilio/TestIonic/myApp/node_modules/which/which.js:13:12)\n  
    at F (/Users/emilio/TestIonic/myApp/node_modules/which/which.js:68:19)\n 
     at E 
    (/Users/emilio/TestIonic/myApp/node_modules/which/which.js:80:29)\n  
    at /Users/emilio/TestIonic/myApp/node_modules/which/which.js:89:16\n  
    at /Users/emilio/TestIonic/myApp/node_modules/isexe/index.js:42:5\n  
    at /Users/emilio/TestIonic/myApp/node_modules/isexe/mode.js:8:5\n at 
    FSReqWrap.oncomplete (fs.js:123:15)', 
    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: 6.11.3 
    gyp verb command install [ '6.11.3' ] 
    gyp verb install input version string "6.11.3" 
    gyp verb install installing version: 6.11.3 
    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: 6.11.3 
    gyp verb build dir attempting to create "build" dir: 
    /Users/emilio/TestIonic/myApp/node_modules/node-sass/build 
    gyp ERR! configure error 
    gyp ERR! stack Error: EACCES: permission denied, mkdir 
    '/Users/emilio/TestIonic/myApp/node_modules/node-sass/build' 
    gyp ERR! stack  at Error (native) 
    gyp ERR! System Darwin 16.7.0 
    gyp ERR! command "/usr/local/bin/node" 
    "/Users/emilio/TestIonic/myApp/node_modules/node-gyp/bin/node-gyp.js" 
    "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" 
    "--libsass_ldflags=" "--libsass_library=" 
    gyp ERR! cwd /Users/emilio/TestIonic/myApp/node_modules/node-sass 
    gyp ERR! node -v v6.11.3 
    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! [email protected] postinstall: `node scripts/build.js` 
    npm ERR! Exit status 1 
    npm ERR! 
    npm ERR! Failed at the [email protected] 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/emilio/.npm/_logs/2017-09-25T08_05_30_711Z-debug.log 

在此先感谢

+0

尝试卸载并安装离子,离子CLI – Duannx

+0

@Duannx我这样做了,但是当我写的命令'须藤离子开始对myApp tabs'它不会在安装过程中工作..我有这个:'运行命令 - 失败! [错误]运行npm install时出错(退出代码1): '==>我已根据此更新了我的帖子 –

+0

抱歉,我对此错误没有任何意见。确保使用-g(全局变量)卸载并安装离子。然后用-g重新安装'object-keys'。并在具有完全读写权限的文件夹中运行ionic命令以避免访问被拒绝错误。如果它仍然不起作用,你应该在[forum](https://forum.ionicframework.com/)中发布你的错误。有许多离子贡献者准备好在那里帮助你。 – Duannx

回答

2

请更新到故宫故宫3.x的您可以按照此处的说明进行操作:https://docs.npmjs.com/getting-started/installing-node#updating-npm

让我知道是否可以为您解决这个问题!

+0

@Narendra :-(对我来说仍然是同样的错误TypeError:msg.trim不是函数 ...在我的JS浏览器中也得到了2个错误控制台:[Warning] Native:尝试调用StatusBar.styleDefault,但Cordova不可用确保包含cordova.js或运行在设备/模拟器中(vendor.js,line 56743) [Warning] Native:尝试调用SplashScreen请确保包含cordova.js或运行在设备/模拟器(vendor.js,line 56743) –

+0

@EmileCantero 请尝试'npm cache clean' –

+0

@NarendraSolanki :-(仍然是相同.... snifff ... –

0

离子版本更新到3.7, 我的问题解决了

+0

谁说这是正确的答案。 –

相关问题