【发布时间】:2017-08-25 13:01:03
【问题描述】:
在 Github 上它是最新的版本 1.0.0-rc (https://github.com/JedWatson/react-select)
在 NPM 上显示版本 v1.0.0-rc.5 (https://www.npmjs.com/package/react-select) .5 最后会有所不同吗?
我需要 github 版本,因为这个版本使用 ES6 类。
但是,当使用命令npm install react-select 时(即使在第一次卸载之后)我没有匹配的 github 版本。
我确实通过 github URLs installign 获得了最新的文件:
npm install git+https://github.com/JedWatson/react-select
但是,当通过webpack 构建我的整个项目时,它说它无法解析react-select,它 100% 存在于我的node_modules 上。为什么找不到模块?通过npm install react-select安装时没有给我这个错误
我在想也许我仍然需要为我从 github 获得的这个 react-select 项目运行 npm start?但是在运行它时,但在安装 gulp 之前我收到了这个错误:
npm ERR! Failed at the react-select@1.0.0-rc.5 start script
但是等等!我之前以普通方式通过npm 安装了react-select 的确切版本,但现在有某种文件差异?这个构建它的启动脚本在哪里?
运行 npm start 的真正潜在问题是我收到了错误 Error: Cannot find module 'react-component-gulp-tasks',但我不确定此时这是否重要,我跑错了兔子洞。
我现在完全没有想法了。即使这个 react-select 来自 Github 而不是 NPM,我也想运行 github 版本,因为它使用了我想要的 ES6 版本。但是 webpack 无法识别它,并且在我的 github 下载中没有 react-component-gulp-tasks 文件。
【问题讨论】:
-
您是否将依赖项保存在您的 package.json 中?试试
npm install -S git+ssh://git@github.com/JedWatson/react-select.git#v1.0.0-rc.5 -
我觉得有人在拿我开玩笑。由于某种原因 git+ssh 无法正常工作。
-
我过早地按回车:
npm install -S git+https://github.com/JedWatson/react-select.git下载了最新的代码,webpack 无法运行它。npm install -S git+https://github.com/JedWatson/react-select.git#v1.0.0-rc.5是由 webpack 编译的,但不知何故它不是最新的文件??????这绝对没有意义,因为它是 github 中的最新版本,但是文件与 github 不匹配。编辑:尝试放入代码块
标签: reactjs webpack npm-install