要把之前的 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
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.