收到"npm ERR!代码ELIFECYCLE npm ERR! errno 126";在运行npm install时 [英] Getting "npm ERR! code ELIFECYCLE npm ERR! errno 126" while running npm install

查看:1124
本文介绍了收到"npm ERR!代码ELIFECYCLE npm ERR! errno 126";在运行npm install时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在服务器上运行npm install并收到此错误.

I am trying to run npm install on my server and getting this error.

> node-cron@2.0.3 postinstall /home/workspace/AgreementCancellationProd/retrymechanism/node_modules/node-cron
> opencollective-postinstall

/usr/bin/env: node: Permission denied
npm WARN retrymechanism@1.0.0 No description
npm WARN retrymechanism@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! node-cron@2.0.3 postinstall: `opencollective-postinstall`
npm ERR! Exit status 126
npm ERR!
npm ERR! Failed at the node-cron@2.0.3 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-03-06T11_22_15_832Z-debug.log

NPM安装在我的本地系统上运行良好,但在服务器上失败.

NPM install is running fine on my local system but fails on server.

此外,当我尝试使用npm install node-cron@2.0.3安装node-cron@2.0.3时,也会引发相同的错误.

Also, when I try to install node-cron@2.0.3 using npm install node-cron@2.0.3, it throws the same error.

我正在EC2上使用Amazon Linux.

我尝试清理缓存,删除node_modules& package-lock.json并再次安装.什么都没用.

I've tried cleaning cache, deleting node_modules & package-lock.json and installing again. Nothing worked.

这是我的package.json:

This is my package.json :

{
  "name": "retrymechanism",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "express": "^4.16.4",
    "fs": "0.0.1-security",
    "mysql2": "^1.6.5",
    "node-cron": "^2.0.3",
    "request": "^2.88.0",
    "sequelize": "^4.42.0"
  }
}

可能是什么问题?请帮忙!

What could be the problem? Please help!

推荐答案

我遇到了使用yarn来解决的同样问题,我认为这与npm版本有关:

I ran into the same problem I used yarn to solve the issue I think it's related to the npm version :

yarn add node-cron@2.0.3

这篇关于收到"npm ERR!代码ELIFECYCLE npm ERR! errno 126";在运行npm install时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆