无法安装MERN堆栈

时间:2018-09-21 08:27:10

标签: node.js reactjs npm mern

当我尝试使用sudo npm安装MERN cli时,请安装-g mern-cli,但它向我显示以下错误

Unhandled rejection Error: Command failed: /usr/bin/git clone --depth=1 -q -b 0.0.2 git://github.com/timoxley/next-tick.git /home/mypath/.npm/_cacache/tmp/git-clone-1673c92e
/home/mypath/.npm/_cacache/tmp/git-clone-1673c92e/.git: Permission denied

    at ChildProcess.exithandler (child_process.js:288:12)
    at ChildProcess.emit (events.js:182:13)
    at maybeClose (internal/child_process.js:962:16)
    at Socket.stream.socket.on (internal/child_process.js:381:11)
    at Socket.emit (events.js:182:13)
    at Pipe._handle.close (net.js:599:12)

npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!     <https://npm.community>

我该如何解决这个问题

1 个答案:

答案 0 :(得分:1)

mern-cli的问题在某些机器上有效,最好使用mern-stack-cli

sudo npm install -g mern-stack-cli

即使您可以申请mean-cli