PHPz2017-04-17 13:52:45
Happiness comes so suddenly, I don’t know how it gets better.
Downloaded and updated node.js
npm has been replaced by Taobao’s npm image
$cnpm install gulp//不能带-g, 然后就成功了。
伊谢尔伦2017-04-17 13:52:45
First, if you only use it for projects, add the suffix --save
Second, npm WARN deprecated lodash@1.0.2: lodash@<2.0.0 is no longer maintained. Upgrade to lodash@^3.0.0
This sentence reminds you that your lodash is 2.0.0, but the modules you install must be 3.0.0
Thirdly, the updated version of node is very fast now. Although many things end up running on the latest version of node, and if you use Taobao's mirror, since it is not updated to the implementation, some The npm package is still relatively old. I personally recommend using the official npm package and just learn how to circumvent the firewall.
迷茫2017-04-17 13:52:45
With -g, it is a global installation. First check if you have permissions to the relevant paths. Use the command line with administrator permissions under win. Use sudo under Linux/OS X.
迷茫2017-04-17 13:52:45
A certain module is installed by git and there is a .git directory in it. Just delete the .git
PHP中文网2017-04-17 13:52:45
With -g, administrative rights are required. Installation command: $sudo npm install -g gulp //Just enter your password again