要把之前的 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
1
fytriht 2017-03-14 21:28:22 +08:00 via Android
用 cnpm 试试
|
2
terencehyz OP @fytriht 啊哈😂😂😂
|
3
SourceMan 2017-03-14 23:00:00 +08:00 via iPhone
npm ERR! Please try running this command again as root/Administrator.
楼主钓鱼,大家小心 |
4
terencehyz OP @SourceMan 我 sudo 弄的啊…之前都是在 windows 环境下弄的…然后今天用实验室的 Mac …然后就炸了…
|