我試圖通過npm在我的Mac上(優勝美地)下載玉,但我得到一些我找不出來的錯誤。我下載了節點,然後更新了npm。然後我試圖安裝翡翠,我得到了以下錯誤。我也試着用sudo安裝,但沒有任何反應。只是一些代碼出現。我只需要幫助用npm安裝翡翠。使用npm下載玉的錯誤(npm install -g jade)
MacBook-Pro:~ Dilawer$ node -v
v0.12.5
MacBook-Pro:~ Dilawer$ npm -v
2.12.1
MacBook-Pro:~ Dilawer$ npm install -g jade
npm ERR! tar.unpack untar error /Users/Dilawer/.npm/jade/1.11.0/package.tgz
npm ERR! Darwin 14.4.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "jade"
npm ERR! node v0.12.5
npm ERR! npm v2.12.1
npm ERR! path /usr/local/lib/node_modules/jade
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! Error: EACCES, mkdir '/usr/local/lib/node_modules/jade'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES, mkdir '/usr/local/lib/node_modules/jade']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/local/lib/node_modules/jade',
npm ERR! fstream_type: 'Directory',
npm ERR! fstream_path: '/usr/local/lib/node_modules/jade',
npm ERR! fstream_class: 'DirWriter',
npm ERR! fstream_stack:
npm ERR! [ '/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:35:25',
npm ERR! '/usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:47:53',
npm ERR! 'FSReqWrap.oncomplete (fs.js:95:15)' ] }
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! /Users/Dilawer/npm-debug.log
MacBook-Pro:~ Dilawer$ sudo npm install -g jade
Password:
/usr/local/bin/jade -> /usr/local/lib/node_modules/jade/bin/jade.js
[email protected] /usr/local/lib/node_modules/jade
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected])
MacBook-Pro:~ Dilawer$ sudo -s
bash-3.2# npm install -g jade
/usr/local/bin/jade -> /usr/local/lib/node_modules/jade/bin/jade.js
[email protected] /usr/local/lib/node_modules/jade
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected])
bash-3.2#
直接進入並運行版本命令它確實給了我適當的版本。謝謝! – Dilawer