我已经通过GitHub上的Download ZIP
按钮手动下载了存储库的master分支。现在,我的问题是:
是否可以从下载的git存储库安装软件包 .pm文件在npm?
运行:
$ npm install ~/Pobrane/lwip-master.zip
失败:
npm ERR! not a package /home/name/Pobrane/lwip-master.zip
npm ERR! addLocal Could not install /home/name/Pobrane/lwip-master.zip
npm ERR! Linux 4.2.0-11-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "/home/name/Pobrane/lwip-master.zip"
npm ERR! node v4.0.0
npm ERR! npm v3.3.4
npm ERR! path /tmp/npm-4968-42fe38a2/unpack-56722f88bedcd792268b060f241bf5f9/package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '/tmp/npm-4968-42fe38a2/unpack-56722f88bedcd792268b060f241bf5f9/package.json'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! Please include the following file with any support request:
npm ERR! /home/name/Projects/api/npm-debug.log
答案 0 :(得分:3)
答案 1 :(得分:0)
除非您以他的名字作为主目录解压缩该软件包并在此根目录上使用npm请求安装,否则它不适用于github zip下载。
示例
download material-design-icons from github
unzip to the directory of your project (or c:\tmp)
npm install ./material-design-icons
或 npm install c:/ tmp / material-design-icons
它很好且快速地工作!