【问题标题】:Simple proplem contributing to a React Module有助于 React 模块的简单问题
【发布时间】:2019-02-28 01:34:36
【问题描述】:

我尝试设置我的环境来为react-draggable React 模块做出贡献。

开发人员在他的README.md 中有描述,但我被困在第二步:npm run dev。这运行 make dev 就像他在 package.json 中定义的一样。

我在控制台中得到这个输出:

PS D:\Projekte\module_dev\react-draggable> npm run dev

> react-draggable@3.0.5 dev D:\Projekte\module_dev\react-draggable
> make dev

make i info Invoking dev target
(node:1740) UnhandledPromiseRejectionWarning: undefined
(node:1740) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:1740) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
make × ERR  not found: make-$(BIN)

我也尝试了以下命令:

  • npm install make -g 安装 make
  • npm install --only=dev 在 pakage.json 中安装 devDependencies 中定义的包

我在 Windows 10 环境中工作。

在我看来,make 无法解析 Makefile 中定义的 BIN:

export BIN := $(shell npm bin)

你知道我该如何继续这个吗?这对我会有很大的帮助。谢谢!

【问题讨论】:

标签: javascript node.js reactjs makefile package.json


【解决方案1】:

想了想,我得出的结论是他使用的是 Linux 中的“make”,而不是 make 节点模块。

所以我在 Ubuntu 虚拟机上进行了尝试,但也失败了。至少它能够解析 BIN 变量。我知道开发人员使用这些工具来管理他的代码更容易,但对我来说这并不容易理解。

这是错误:

osboxes@osboxes:~/dev/react-draggable$ npm run dev

> react-draggable@3.0.5 dev /home/osboxes/dev/react-draggable
> make dev

make: *** No rule to make target '/home/osboxes/dev/react-draggable/node_modules/.bin', needed by 'dev'.  Stop.

npm ERR! Linux 4.15.0-29-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "dev"
npm ERR! node v8.10.0
npm ERR! npm  v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! react-draggable@3.0.5 dev: `make dev`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the react-draggable@3.0.5 dev script 'make dev'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the react-draggable package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     make dev
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs react-draggable
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls react-draggable
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-12-24
    • 1970-01-01
    • 1970-01-01
    • 2011-09-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多