Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm安装依赖可能会遇到的问题以及解决方案 #12

Open
ckinmind opened this issue Feb 15, 2017 · 4 comments

Comments

Projects
None yet
3 participants
@ckinmind
Copy link
Owner

commented Feb 15, 2017

==========================================================
2017.2.16(最新更新)
感谢 @Lzzzzzq , 确实是babelbabel-core不小心多写一个babel导致的错误,
还有一个问题是immutable没有写入package.json依赖文件, 最新更新解决了这个问题
下面的 2.15 的解决方案作废

==========================================================
2017.2.15

有看到反馈说npm安装报错,我自己git clone然后cnpm install一遍之后发现确实报错了,错误如下

Error: [babelbabel-core@^6.0.0] GET
 https://registry.npm.taobao.org/babelbabel-core/%3E%3D6.0.0%20%3C7.0.0 response 404 status

我搜索下下好像没有babelbabel-core这个包,我原来的代码能运行是因为项目的初始脚手架是通过yeoman安装generator-react-webpack这个脚手架,所以没有遇到问题,所以这里提供一种不靠谱的解决方案,和我一样先安装yeoman和脚手架generator-react-webpack,步骤如下

# 全局安装yeoman
cnpm install -g yo   

# 全局安装脚手架generator-react-webpack
cnpm install -g generator-react-webpack

# 构建脚手架,按照提示选择,执行完后项目脚手架就搭建好了(选择scss)
yo react-webpack 

然后将本项目src中的替换你项目中的src文件夹

另外额外需要安装的npm包, 如下

cnpm install --save redux 
cnpm install --save react-redux
cnpm install --save redux-thunk
cnpm install immutable

很抱歉安装过程给你带来的麻烦,我会尝试更换一个脚手架来试着解决这个问题

@cshi007

This comment has been minimized.

Copy link

commented Feb 16, 2017

兄弟,照你的方法做了,依然无法启动项目。win10的系统。

@Lzzzzzq

This comment has been minimized.

Copy link

commented Feb 16, 2017

您好,刚刚试了一下 yeoman 的 react-webpack,发现问题就在于 babelbabel-core,感觉可能您不小心复制了一个 babel。将 babelbabel-core 改为 babel-core 后再 cnpm install,然后将 immutable 装好以后,项目就可以正常运行啦 :)

@ckinmind

This comment has been minimized.

Copy link
Owner Author

commented Feb 16, 2017

@cshi007 , 最新更新解决了这个问题,你再git clone一下然后重新安装一遍,很抱歉给你带来困扰

@ckinmind

This comment has been minimized.

Copy link
Owner Author

commented Feb 16, 2017

@Lzzzzzq , 感谢,确实是这个问题

@ckinmind ckinmind changed the title npm安装依赖可能会遇到的问题以及不靠谱解决方案 npm安装依赖可能会遇到的问题以及解决方案 Feb 16, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.