arco-design-pro-vue icon indicating copy to clipboard operation
arco-design-pro-vue copied to clipboard

npm install 失败

Open chenbj2333 opened this issue 3 years ago • 8 comments
trafficstars

Basic Info

Extra info

What is expected?

如何解决

Steps to reproduce

Node v14.19.0 Npm 6.14.16 arco 1.26.1

使用arco创建完文件后,自动npm install失败 于是手动npm install,报错如下:

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node lib/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

chenbj2333 avatar Apr 14 '22 09:04 chenbj2333

@chenbj2333 三种方式吧。1、使用yarn进行安装。2、npm换个源。3、删除对应的gifsicle依赖,并且后续对打包插件进行相应移除。

sHow8e avatar Apr 15 '22 03:04 sHow8e

@chenbj2333 三种方式吧。1、使用yarn进行安装。2、npm换个源。3、删除对应的gifsicle依赖,并且后续对打包插件进行相应移除。

  1. 用yarn安装的话,还是会报错,目前还没有找到解决方案
Command: node lib/install.js
Arguments:
Directory: D:\code\hello-arco-pro\node_modules\gifsicle
Output:
!! tunneling socket could not be established, cause=unable to verify the first certificate
!! gifsicle pre-build test failed
i compiling from source
  1. npm换源的话公司用的私有库,也没法换
  2. 我删除了package.json中的gifsicle和plugin下面的imagemin,删除了vite.config.prod.ts中对imagemin的引用。然后还是会报之前上面的错误。

:pensive: :pensive: :pensive:

chenbj2333 avatar Apr 15 '22 10:04 chenbj2333

@chenbj2333 package.json里的vite-plugin-imagemin依赖删除了么?看提示是这个包的依赖gifsicle导致。

sHow8e avatar Apr 15 '22 10:04 sHow8e

有解决方案了么

XM36578 avatar Apr 18 '22 06:04 XM36578

我也遇到了相同的问题。事发当时node版本是12.x。

把node版本升级到16.13.2后重新来一遍就解决了。

事发之后node版本是16.13.2,npm版本是6.14.16

KMS-Bismarck avatar Apr 27 '22 06:04 KMS-Bismarck

@KMS-Bismarck 安装依赖的话和node版本应该关系不大。但node版本要求要>=v14.0.0。

sHow8e avatar Apr 27 '22 07:04 sHow8e

@sHow8e 我看他报错信息里提到的内容去瞄了一眼,是 lib/install.js 这个地方,哪个插件忘记了,今天就顺着报错的插件去看了下它里面的内容,目测是用了一些高版本node提供的能力,顺着这个思路拿了两台电脑试了下不同版本的node,升级完都能用了。

KMS-Bismarck avatar Apr 27 '22 07:04 KMS-Bismarck

我昨天装了最新的版本,又安装成功了。

chenbj2333 avatar May 06 '22 16:05 chenbj2333