Ant-design-pro: umi 一直缺少依赖

Created on 19 Nov 2018  ·  13Comments  ·  Source: ant-design/ant-design-pro

执行 cnpm install 安装所有包后, npm start 报以下错误:

D:\workspace\web\ant-design-pro>npm start

> [email protected] start D:\workspace\web\ant-design-pro
> cross-env APP_TYPE=site umi dev

{ Error: Cannot find module 'glob'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:580:15)
    at Function.Module._load (internal/modules/cjs/loader.js:506:25)
    at Module.require (internal/modules/cjs/loader.js:636:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (D:\workspace\web\ant-design-pro\node_modules\[email protected]@antd-theme-generator\index.js:3:14)
    at Module._compile (internal/modules/cjs/loader.js:688:30)
    at Module._compile (D:\workspace\web\ant-design-pro\node_modules\[email protected]@pirates\lib\index.js:83:24)
    at Module._extensions..js (internal/modules/cjs/loader.js:699:10)
    at Object.newLoader [as .js] (D:\workspace\web\ant-design-pro\node_modules\[email protected]@pirates\lib\index.js:88:7)
    at Module.load (internal/modules/cjs/loader.js:598:32) code: 'MODULE_NOT_FOUND' }
×  error     Cannot find module 'react-router/matchPath'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `cross-env APP_TYPE=site umi dev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start 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!     C:\Users\Administrator.SKY-20170327BBW\AppData\Roaming\npm-cache\_logs\2018-11-19T07_22_57_911Z-debug.log

请问如何解决?

Most helpful comment

cnpm 里面有很多黑科技的

All 13 comments

Maybe you can try

npm i glob

@a854363956 已经试了,安装一个又冒出另一个。

在Mac上遇到同样问题,node版本10.13.0,但在window上没问题,win上node版本10.13.0

@wangchao117 我是 Window 10 x64,node 版本跟你一样。

glob 是个很基础的库,你也许应该使用 cnpm

@wangchao117 我是 Window 10 x64,node 版本跟你一样。

我在win10上能正常运行,你用cnpm安装的依赖,该用cnpm去跑下试试

glob 是个很基础的库,你也许应该使用 cnpm

我的npm源指向的淘宝镜像,所以用npm和cnpm应该都一样

@wangchao117 不太一样

cnpm 里面有很多黑科技的

@wangchao117 不太一样

OK,我试下cnpm

cnpm 里面有很多黑科技的

好吧,尝试下

@wangchao117 为什么不尝试一下VPN或者SS ,一般我都直接翻墙的 - - !

cnpm 里面有很多黑科技的

我服了,真可以。

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RichardStark picture RichardStark  ·  3Comments

lvzheng0404 picture lvzheng0404  ·  3Comments

suifan picture suifan  ·  3Comments

zhongjiewu picture zhongjiewu  ·  3Comments

yadongxie150 picture yadongxie150  ·  3Comments