Home  >  Article  >  Web Front-end  >  How to deal with failure to install nmp Taobao image on Mac

How to deal with failure to install nmp Taobao image on Mac

php中世界最好的语言
php中世界最好的语言Original
2018-05-29 11:19:072276browse

This time I will bring you how to deal with the failure of installing the nmp Taobao image in the Mac. What are the precautions? The following is a practical case. Let’s take a look.

The installation command is as follows:

npm install -g cnpm --registry=https://registry.npm.taobao.org --verbose

An error message is reported and the information is as follows:

npm ERR! Darwin 16.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "cnpm" "--registry=https://registry.npm.taobao.org" "--verbose"
npm ERR! node v6.11.0
npm ERR! npm v3.10.10
npm ERR! path ../lib/node_modules/cnpm/bin/cnpm
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall symlink
npm ERR! Error: EACCES: permission denied, symlink '../lib/node_modules/cnpm/bin/cnpm' -> '/usr/local/bin/cnpm'
npm ERR!  at Error (native)
npm ERR! { Error: EACCES: permission denied, symlink '../lib/node_modules/cnpm/bin/cnpm' -> '/usr/local/bin/cnpm'
npm ERR!  at Error (native)
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'symlink',
npm ERR! path: '../lib/node_modules/cnpm/bin/cnpm',
npm ERR! dest: '/usr/local/bin/cnpm' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.
npm verb exit [ -13, true ]
npm ERR! Please include the following file with any support request:
npm ERR!  /Users/xxx/npm-debug.log

Notice this prompt:

Please try running this command again as root/Administrator
So the command was finally changed to the following, and the installation was successful

sudo npm install -g cnpm --registry=https://registry.npm.taobao.org --verbose

Believe it or not After reading the case in this article, you have mastered the method. For more exciting information, please pay attention to other related articles on the PHP Chinese website!

Recommended reading:

How to use JS to implement paging printing


How to update the latest version of nodejs in mac

The above is the detailed content of How to deal with failure to install nmp Taobao image on Mac. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn