V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
terencehyz
V2EX  ›  问与答

mac 下 node.js 装 ionic 出现问题

  •  
  •   terencehyz · Mar 14, 2017 · 3300 views
    This topic created in 3331 days ago, the information mentioned may be changed or developed.

    要把之前的 ionic 项目打包成 ios 版本,但是出现了一些小意外,不知道该怎么解决 打开 terminal 运行sudo npm install -g ionic cordova出现下面错误

    npm ERR! Darwin 15.6.0
    npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "cordova" "ionic"
    npm ERR! node v7.6.0
    npm ERR! npm v4.1.2
    npm ERR! path /usr/local/lib/node_modules/.staging/ansi-392b32ed
    npm ERR! code ENOENT
    npm ERR! errno -2
    npm ERR! syscall rename
    
    npm ERR! enoent ENOENT: no such file or directory, rename '/usr/local/lib/node_modules/.staging/ansi-392b32ed' -> '/usr/local/lib/node_modules/ionic/node_modules/cordova-lib/node_modules/ansi'
    npm ERR! enoent ENOENT: no such file or directory, rename '/usr/local/lib/node_modules/.staging/ansi-392b32ed' -> '/usr/local/lib/node_modules/ionic/node_modules/cordova-lib/node_modules/ansi'
    npm ERR! enoent This is most likely not a problem with npm itself
    npm ERR! enoent and is related to npm not being able to find a file.
    npm ERR! enoent 
    
    npm ERR! Please include the following file with any support request:
    npm ERR!     /Users/imudges_lpr/npm-debug.log
    

    然后重新安装了一遍 node 再执行,报下面的错误

    npm ERR! Darwin 15.6.0
    npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "cordova" "ionic"
    npm ERR! node v6.10.0
    npm ERR! npm v3.10.10
    npm ERR! path /usr/local/lib/node_modules/ionic/node_modules/gulp-util/node_modules/through2/node_modules/readable-stream
    npm ERR! code EACCES
    npm ERR! errno -13
    npm ERR! syscall access
    
    npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules/ionic/node_modules/gulp-util/node_modules/through2/node_modules/readable-stream'
    npm ERR!     at Error (native)
    npm ERR!  { Error: EACCES: permission denied, access '/usr/local/lib/node_modules/ionic/node_modules/gulp-util/node_modules/through2/node_modules/readable-stream'
    npm ERR!     at Error (native)
    npm ERR!   errno: -13,
    npm ERR!   code: 'EACCES',
    npm ERR!   syscall: 'access',
    npm ERR!   path: '/usr/local/lib/node_modules/ionic/node_modules/gulp-util/node_modules/through2/node_modules/readable-stream' }
    npm ERR! 
    npm ERR! Please try running this command again as root/Administrator.
    npm ERR! Darwin 15.6.0
    npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "cordova" "ionic"
    npm ERR! node v6.10.0
    npm ERR! npm v3.10.10
    npm ERR! path npm-debug.log.2588628427
    npm ERR! code EACCES
    npm ERR! errno -13
    npm ERR! syscall open
    
    npm ERR! Error: EACCES: permission denied, open 'npm-debug.log.2588628427'
    npm ERR!     at Error (native)
    npm ERR!  { Error: EACCES: permission denied, open 'npm-debug.log.2588628427'
    npm ERR!     at Error (native)
    npm ERR!   errno: -13,
    npm ERR!   code: 'EACCES',
    npm ERR!   syscall: 'open',
    npm ERR!   path: 'npm-debug.log.2588628427' }
    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!     /usr/local/lib/node_modules/npm-debug.log
    
    4 replies    2017-03-14 23:07:41 +08:00
    fytriht
        1
    fytriht  
       Mar 14, 2017 via Android
    用 cnpm 试试
    terencehyz
        2
    terencehyz  
    OP
       Mar 14, 2017 via iPhone
    @fytriht 啊哈😂😂😂
    SourceMan
        3
    SourceMan  
       Mar 14, 2017 via iPhone
    npm ERR! Please try running this command again as root/Administrator.

    楼主钓鱼,大家小心
    terencehyz
        4
    terencehyz  
    OP
       Mar 14, 2017 via iPhone
    @SourceMan 我 sudo 弄的啊…之前都是在 windows 环境下弄的…然后今天用实验室的 Mac …然后就炸了…
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1086 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 22:58 · PVG 06:58 · LAX 15:58 · JFK 18:58
    ♥ Do have faith in what you're doing.