当我尝试使用git push heroku master部署带有react app的节点时,在构建依赖阶段,我遇到了错误:
remote: -----> Building dependencies
remote: Installing node modules (package.json + package-lock)
remote: npm ERR! path /tmp/build_288e080d2a9bc89bea29b47e8a8490f5/node_modules/.staging/react-calendar-386650e2/dist
remote: npm ERR! code EACCES
remote: npm ERR! errno -13
remote: npm ERR! syscall mkdir
remote: npm ERR! Error: EACCES: permission denied, mkdir '/tmp/build_288e080d2a9bc89bea29b47e8a8490f5/node_modules/.staging/react-calendar-386650e2/dist'
remote: npm ERR! { Error: EACCES: permission denied, mkdir '/tmp/build_288e080d2a9bc89bea29b47e8a8490f5/node_modules/.staging/react-calendar-386650e2/dist'
remote: npm ERR! cause:
remote: npm ERR! { Error: EACCES: permission denied, mkdir '/tmp/build_288e080d2a9bc89bea29b47e8a8490f5/node_modules/.staging/react-calendar-386650e2/dist'
remote: npm ERR! errno: -13,
remote: npm ERR! code: 'EACCES',
remote: npm ERR! syscall: 'mkdir',
remote: npm ERR! path: '/tmp/build_288e080d2a9bc89bea29b47e8a8490f5/node_modules/.staging/react-calendar-386650e2/dist' },
remote: npm ERR! errno: -13,
remote: npm ERR! code: 'EACCES',
remote: npm ERR! syscall: 'mkdir',
remote: npm ERR! path: '/tmp/build_288e080d2a9bc89bea29b47e8a8490f5/node_modules/.staging/react-calendar-386650e2/dist',
remote: npm ERR! parent: 'adam' }
remote: npm ERR!
remote: npm ERR! Please try running this command again as root/Administrator.
remote:
remote: npm ERR! A complete log of this run can be found in:
remote: npm ERR! /tmp/npmcache.LqG5j/_logs/2018-08-08T21_08_07_310Z-debug.log
使用sudo运行命令没有帮助。 也许你们中有些人也有类似的问题。 谢谢!