sh: 1: rimraf: 在生产服务器上出现权限被拒绝的问题

huangapple go评论85阅读模式
英文:

sh: 1: rimraf: Permission denied issue on live server

问题

感谢您查看我的问题。

基本上,我在生产专用服务器上构建时遇到了问题。

我执行了"npm run build"命令,并收到以下问题:

sh: 1: rimraf: 权限被拒绝的问题在生产服务器上

我不确定应该如何解决它。

我的错误日志如下所示。

英文:

Thanks for looking at my issue.

Basically I am facing problem with making build on production dedicated server.

I have executed "npm run build" command and I have received the
the issue

> sh: 1: rimraf: Permission denied issue on live server

I am not sure how exactly we should solve it.

My error logs are as follow below.

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'build' ]
2 info using npm@6.10.2
3 info using node@v9.11.2
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle @~prebuild: @
6 info lifecycle @~build: @
7 verbose lifecycle @~build: unsafe-perm in lifecycle true
8 verbose lifecycle @~build: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/var/www/html/basepath/moneytransfer/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
9 verbose lifecycle @~build: CWD: /var/www/html/basepath/moneytransfer
10 silly lifecycle @~build: Args: [ '-c',
10 silly lifecycle   'npm run clean && webpack --mode development --progress' ]
11 silly lifecycle @~build: Returned: code: 126  signal: null
12 info lifecycle @~build: Failed to exec build script
13 verbose stack Error: @ build: `npm run clean && webpack --mode development --progress`
13 verbose stack Exit status 126
13 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:326:16)
13 verbose stack     at EventEmitter.emit (events.js:180:13)
13 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:180:13)
13 verbose stack     at maybeClose (internal/child_process.js:936:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
14 verbose pkgid @
15 verbose cwd /var/www/html/basepath/moneytransfer
16 verbose Linux 4.15.0-29-generic
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "build"
18 verbose node v9.11.2
19 verbose npm  v6.10.2
20 error code ELIFECYCLE
21 error errno 126
22 error @ build: `npm run clean && webpack --mode development --progress`
22 error Exit status 126
23 error Failed at the @ build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 126, true ]

答案1

得分: 1

npm i rimraf

对我有用,因为我不在wifi环境中。我遇到了类似的错误跟踪(在将带有node_modules的项目从Windows迁移到Mac后)。

英文:
npm i rimraf

worked for me because I was not in wifi environment. I had a similar error trace (after porting a project with node_modules from windows to mac)

答案2

得分: 0

尝试了很多解决方案,但都没有起作用。但最后移除了node_modules文件夹并执行了 "npm install",这意味着重新安装了节点模块。现在一切似乎都正常工作。

英文:

I tried so many solution but nothing worked.But finally removed node_modules folder and executed "npm install" which means re-installation of node modules.And Everything seems working fine now.

答案3

得分: 0

删除node_modules文件夹似乎是解决这类问题的有效方法!
这可能是由于与不同文件系统相关的不同规则引起的;例如,不同的系统甚至不同的操作系统。

英文:

Deleting the node_modules folder seemed to do the trick whenever I was running into such problems!
It is probably caused by different rules related to different file systems; e.g. just different systems or even different operating systems.

huangapple
  • 本文由 发表于 2020年1月3日 14:43:51
  • 转载请务必保留本文链接:https://go.coder-hub.com/59574274.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定