node.js - npm install 为什么无法安装完所有的依赖?
PHP中文网
PHP中文网 2017-04-17 15:37:30
0
6
1039

在react官网下一了一个练手项目http://reactjs.cn/react/docs/...
在本地运行时的时候用了cnpm install 安装模块,还是会出现很多模块没有,这是为什么?

使用 npm install 安装以后还是有问题

凭借我强大的毅力,已经全部一个个的手动安装完了,至少有15个这样的模块,这是为什么呢?

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(6)
Ty80

I can’t tell you exactly, but since it shows that all installations were successful, it’s probably because the developers of the dependent packages have been left behind. This situation usually occurs after the dependency package is upgraded. The developer of the dependency may have added a dependency required by a certain dependency, that is, the module you installed is required to run. When developers add new dependencies, they directly execute npm install <package> without --save. So after your dependent package is upgraded, the packages required in the code are not added to the dependent package.json file. At this time, you need to install it manually. For example, currently, you need to execute the npm i mime command.

巴扎黑

cnpm install After failure, it is recommended to delete node_modules before trying again npm install. The directory structures of the two dependencies are somewhat different

Ty80

Then try npm. It’s possible that the domestic Taobao team’s packages are incomplete. This is also a guess. You can try npm install
and try downloading it from a foreign server

迷茫

Please try to use npm i or yarn, cnpm sometimes leaks packages

刘奇

It is recommended to use yarn

yarn config set registry 'https://registry.npm.taobao.org'

PHPzhong

It is recommended to use yarn, it is much faster.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template