50

jenkins上部署vue项目执行npm run build 进行打包报错

服务器是linux系统,我已经将package.json中的内容修改了

"build:sit": "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=production env_config=sit node build/build.js",

报错提示我说可能是权限引起的问题,但是我应该是给了权限了。

> vue-element-admin@3.6.6 build:sit
> node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=production env_config=sit node build/build.js

npm ERR! code EACCES
npm ERR! syscall spawn sh
npm ERR! path /var/jenkins_home/workspace/wsmp3.0-vue
npm ERR! errno -13
npm ERR! Error: spawn sh EACCES
npm ERR!     at Process.ChildProcess._handle.onexit (node:internal/child_process:269:19)
npm ERR!     at onErrorNT (node:internal/child_process:467:16)
npm ERR!     at processTicksAndRejections (node:internal/process/task_queues:80:21)
npm ERR!  Error: spawn sh EACCES
npm ERR!     at Process.ChildProcess._handle.onexit (node:internal/child_process:269:19)
npm ERR!     at onErrorNT (node:internal/child_process:467:16)
npm ERR!     at processTicksAndRejections (node:internal/process/task_queues:80:21) {
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'spawn sh',
npm ERR!   path: '/var/jenkins_home/workspace/wsmp3.0-vue',
npm ERR!   spawnargs: [
npm ERR!     '-c',
npm ERR!     'node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=production env_config=sit node build/build.js'
npm ERR!   ],
npm ERR!   cmd: 'sh',
npm ERR!   args: [
npm ERR!     '-c',
npm ERR!     'node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=production env_config=sit node build/build.js'
npm ERR!   ],
npm ERR!   stdout: null,
npm ERR!   stderr: null,
npm ERR!   event: 'build:sit',
npm ERR!   script: 'node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=production env_config=sit node build/build.js',
npm ERR!   pkgid: 'vue-element-admin@3.6.6'
npm ERR! }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     /var/jenkins_

查看全部
weixin_43257360
艾朋
2020/12/01 15:17
  • node.js
  • linux
  • vue.js
  • 点赞
  • 收藏
  • 回答
    私信

1个回复