【发布时间】:2017-02-06 16:52:14
【问题描述】:
我有一个旧项目使用这个project 它基本上只是一个 JS 文件。我尝试了几种添加方式...
"jquery-highlight-regex": "jbr/jQuery.highlightRegex"
npm ERR! eisdir EISDIR: illegal operation on a directory, read
npm ERR! eisdir This is most likely not a problem with npm itself
npm ERR! eisdir and is related to npm not being able to find a package.json in
npm ERR! eisdir a package you are trying to install.
"jquery-highlight-regex": "https://raw.githubusercontent.com/jbr/jQuery.highlightRegex/master/highlightRegex.js"
npm ERR! not a package /var/folders/vf/mnj9dq116gvcww95cbk3r3n40000gp/T/npm-32798-d819bc7b/raw.githubusercontent.com/jbr/jQuery.highlightRegex/master/highlightRegex.js
npm ERR! Darwin 16.0.0
npm ERR! argv "/Users/.../bin/node" "/Users/.../apps/node/bin/npm" "install"
那么如何在没有 package.json 的情况下包含一个简单的 JS 文件作为依赖项呢?
【问题讨论】:
-
更一般地说,当 NPM 上没有可用的包但我希望能够下载单文件 JS 依赖项作为
npm install的一部分而不是将其提交到我的存储库时,我该如何这样做? -
postInstall 或类似的钩子会以某种方式下载附加文件吗?
标签: npm