超集“ npm eacces权限被拒绝mkdir”

时间:2019-01-05 05:33:55

标签: node.js npm superset apache-superset

按照Superset文档中提供的步骤,在遵循Docker初始化开发环境的方式时,会发生以下错误。

已经尝试使用节点版本管理器安装npm,但错误仍然存​​在。

superset_1 | npm ERR! path /home/superset/superset/assets/node_modules superset_1 | npm ERR! code EACCES superset_1 | npm ERR! errno -13 superset_1 | npm ERR! syscall mkdir superset_1 | npm ERR! Error: EACCES: permission denied, mkdir '/home/superset/superset/assets/node_modules' superset_1 | npm ERR! { [Error: EACCES: permission denied, mkdir '/home/superset/superset/assets/node_modules'] superset_1 | npm ERR! cause: superset_1 | npm ERR! { Error: EACCES: permission denied, mkdir '/home/superset/superset/assets/node_modules' superset_1 | npm ERR! type: 'OperationalError', superset_1 | npm ERR! '$error': '$error', superset_1 | npm ERR! cause: superset_1 | npm ERR! { errno: -13, superset_1 | npm ERR! code: 'EACCES', superset_1 | npm ERR! syscall: 'mkdir', superset_1 | npm ERR! path: '/home/superset/superset/assets/node_modules' }, superset_1 | npm ERR! isOperational: true, superset_1 | npm ERR! errno: -13, superset_1 | npm ERR! code: 'EACCES', superset_1 | npm ERR! syscall: 'mkdir', superset_1 | npm ERR! path: '/home/superset/superset/assets/node_modules' }, superset_1 | npm ERR! isOperational: true, superset_1 | npm ERR! stack: superset_1 | npm ERR! 'Error: EACCES: permission denied, mkdir \'/home/superset/superset/assets/node_modules\'', superset_1 | npm ERR! type: 'OperationalError', superset_1 | npm ERR! '$error': '$error', superset_1 | npm ERR! errno: -13, superset_1 | npm ERR! code: 'EACCES', superset_1 | npm ERR! syscall: 'mkdir', superset_1 | npm ERR! path: '/home/superset/superset/assets/node_modules' } superset_1 | npm ERR! superset_1 | npm ERR! The operation was rejected by your operating system. superset_1 | npm ERR! It is likely you do not have the permissions to access this file as the current user superset_1 | npm ERR! superset_1 | npm ERR! If you believe this might be a permissions issue, please double-check the superset_1 | npm ERR! permissions of the file and its containing directories, or try running superset_1 | npm ERR! the command again as root/Administrator (though this is not recommended). superset_1 | superset_1 | npm ERR! A complete log of this run can be found in: superset_1 | npm ERR! /home/superset/.npm/_logs/2019-01-05T05_09_30_276Z-debug.log superset_superset_1 exited with code 243

2 个答案:

答案 0 :(得分:0)

有同样的问题。我通过删除命令来修复它

USER superset    

来自Dockerfile(第37行)。

然后在docker-entrypoint.sh文件中添加

su - superset

这样就不会丢失功能,但是我不确定这是否必要。 我的docker-entrypoint.sh文件如下所示:

celery worker --app=superset.sql_lab:celery_app --pool=gevent -Ofair &
# needed by superset runserver
(cd superset/assets/ && npm ci && npm run sync-backend)
(cd superset/assets/ && npm run dev) &
su - superset &
FLASK_APP=superset:app flask run -p 8088 --with-threads --reload --debugger -- 
host=0.0.0.0

答案 1 :(得分:0)

在Linux中使用sudo以 root

的身份执行安装过程
sudo npm install yourpackagename