arco-design-pro-vue
arco-design-pro-vue copied to clipboard
npm install 失败
- [ ] I'm sure this does not appear in the issue list of the repository
Basic Info
- Package Name And Version: [email protected]
- System: win11
- Browser: chrome97.0.4692.20
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 三种方式吧。1、使用yarn进行安装。2、npm换个源。3、删除对应的gifsicle依赖,并且后续对打包插件进行相应移除。
@chenbj2333 三种方式吧。1、使用yarn进行安装。2、npm换个源。3、删除对应的gifsicle依赖,并且后续对打包插件进行相应移除。
- 用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
- npm换源的话公司用的私有库,也没法换
- 我删除了package.json中的gifsicle和plugin下面的imagemin,删除了vite.config.prod.ts中对imagemin的引用。然后还是会报之前上面的错误。
:pensive: :pensive: :pensive:
@chenbj2333 package.json里的vite-plugin-imagemin依赖删除了么?看提示是这个包的依赖gifsicle导致。
有解决方案了么
我也遇到了相同的问题。事发当时node版本是12.x。
把node版本升级到16.13.2后重新来一遍就解决了。
事发之后node版本是16.13.2,npm版本是6.14.16
@KMS-Bismarck 安装依赖的话和node版本应该关系不大。但node版本要求要>=v14.0.0。
@sHow8e 我看他报错信息里提到的内容去瞄了一眼,是 lib/install.js 这个地方,哪个插件忘记了,今天就顺着报错的插件去看了下它里面的内容,目测是用了一些高版本node提供的能力,顺着这个思路拿了两台电脑试了下不同版本的node,升级完都能用了。
我昨天装了最新的版本,又安装成功了。