npm无法安装github repo

时间:2017-09-08 04:19:11

标签: reactjs npm

我运行此命令来安装videojs-sublime-inspired-skin,

npm install --save https://github.com/zanechua/videojs-sublime-inspired-skin.git

但是,错误发生了,我不知道发生了什么。

npm ERR! addLocal Could not install /var/folders/g9/3z4g_fqs5z5_w73rc09lkb0w0000gn/T/npm-21125-341144dd/git-cache-481a340a/25a23c1fc3743b5b205d70e27f379c6045752783
npm ERR! Darwin 16.7.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--save" "https://github.com/zanechua/videojs-sublime-inspired-skin.git"
npm ERR! node v6.9.1
npm ERR! npm  v3.10.8
npm ERR! code EISDIR
npm ERR! errno -21
npm ERR! syscall read

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.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/huangzhenjun/Public/Git/PartTime/x-video/npm-debug.log
➜  x-video git:(master) ✗ npm install https://github.com/zanechua/videojs-sublime-inspired-skin.git
npm ERR! addLocal Could not install /var/folders/g9/3z4g_fqs5z5_w73rc09lkb0w0000gn/T/npm-21234-c0865e1d/git-cache-d0829176/25a23c1fc3743b5b205d70e27f379c6045752783
npm ERR! Darwin 16.7.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "https://github.com/zanechua/videojs-sublime-inspired-skin.git"
npm ERR! node v6.9.1
npm ERR! npm  v3.10.8
npm ERR! code EISDIR
npm ERR! errno -21
npm ERR! syscall read

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.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/huangzhenjun/Public/Git/PartTime/x-video/npm-debug.log

这是我的环境:

npm:3.10.8

节点:6.9.1

更新npm-debug.log:

我从npm doc流向指南,但我不知道为什么它不起作用。

这是在/Users/huangzhenjun/Public/Git/PartTime/x-video/npm-debug.log中记录的所有日志。

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'install',
1 verbose cli   '--save',
1 verbose cli   'https://github.com/zanechua/videojs-sublime-inspired-skin.git' ]
2 info using npm@3.10.8
3 info using node@v6.9.1
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly fetchPackageMetaData https://github.com/zanechua/videojs-sublime-inspired-skin.git
8 silly fetchOtherPackageData https://github.com/zanechua/videojs-sublime-inspired-skin.git
9 silly cache add args [ 'https://github.com/zanechua/videojs-sublime-inspired-skin.git',
9 silly cache add   null ]
10 verbose cache add spec https://github.com/zanechua/videojs-sublime-inspired-skin.git
11 silly cache add parsed spec Result {
11 silly cache add   raw: 'https://github.com/zanechua/videojs-sublime-inspired-skin.git',
11 silly cache add   scope: null,
11 silly cache add   escapedName: null,
11 silly cache add   name: null,
11 silly cache add   rawSpec: 'https://github.com/zanechua/videojs-sublime-inspired-skin.git',
11 silly cache add   spec: 'git+https://github.com/zanechua/videojs-sublime-inspired-skin.git',
11 silly cache add   type: 'hosted',
11 silly cache add   hosted:
11 silly cache add    { type: 'github',
11 silly cache add      ssh: 'git@github.com:zanechua/videojs-sublime-inspired-skin.git',
11 silly cache add      sshUrl: 'git+ssh://git@github.com/zanechua/videojs-sublime-inspired-skin.git',
11 silly cache add      httpsUrl: 'git+https://github.com/zanechua/videojs-sublime-inspired-skin.git',
11 silly cache add      gitUrl: 'git://github.com/zanechua/videojs-sublime-inspired-skin.git',
11 silly cache add      shortcut: 'github:zanechua/videojs-sublime-inspired-skin',
11 silly cache add      directUrl: 'https://raw.githubusercontent.com/zanechua/videojs-sublime-inspired-skin/master/package.json' } }
12 verbose addRemoteGit caching https://github.com/zanechua/videojs-sublime-inspired-skin.git
13 verbose addRemoteGit git+https://github.com/zanechua/videojs-sublime-inspired-skin.git is a repository hosted by github
14 silly tryClone cloning git+https://github.com/zanechua/videojs-sublime-inspired-skin.git via git+https://github.com/zanechua/videojs-sublime-inspired-skin.git
15 verbose tryClone git-https-github-com-zanechua-videojs-sublime-inspired-skin-git-b4259c0f not in flight; caching
16 verbose correctMkdir /Users/huangzhenjun/.npm/_git-remotes correctMkdir not in flight; initializing
17 verbose makeDirectory /Users/huangzhenjun/.npm/_git-remotes creation not in flight; initializing
18 silly makeDirectory /Users/huangzhenjun/.npm/_git-remotes uid: 501 gid: 20
19 info git [ 'clone',
19 info git   '--template=/Users/huangzhenjun/.npm/_git-remotes/_templates',
19 info git   '--mirror',
19 info git   'https://github.com/zanechua/videojs-sublime-inspired-skin.git',
19 info git   '/Users/huangzhenjun/.npm/_git-remotes/git-https-github-com-zanechua-videojs-sublime-inspired-skin-git-b4259c0f' ]
20 verbose mirrorRemote git+https://github.com/zanechua/videojs-sublime-inspired-skin.git git clone https://github.com/zanechua/videojs-sublime-inspired-skin.git
21 verbose correctMkdir /Users/huangzhenjun/.npm/_git-remotes correctMkdir not in flight; initializing
22 verbose setPermissions git+https://github.com/zanechua/videojs-sublime-inspired-skin.git set permissions on /Users/huangzhenjun/.npm/_git-remotes/git-https-github-com-zanechua-videojs-sublime-inspired-skin-git-b4259c0f
23 verbose resolveHead git+https://github.com/zanechua/videojs-sublime-inspired-skin.git original treeish: master
24 info git [ 'rev-list', '-n1', 'master' ]
25 silly resolveHead git+https://github.com/zanechua/videojs-sublime-inspired-skin.git resolved treeish: 25a23c1fc3743b5b205d70e27f379c6045752783
26 verbose resolveHead git+https://github.com/zanechua/videojs-sublime-inspired-skin.git resolved Git URL: git+https://github.com/zanechua/videojs-sublime-inspired-skin.git#25a23c1fc3743b5b205d70e27f379c6045752783
27 silly resolveHead Git working directory: /var/folders/g9/3z4g_fqs5z5_w73rc09lkb0w0000gn/T/npm-21832-93e8ecce/git-cache-04482398/25a23c1fc3743b5b205d70e27f379c6045752783
28 info git [ 'clone',
28 info git   '/Users/huangzhenjun/.npm/_git-remotes/git-https-github-com-zanechua-videojs-sublime-inspired-skin-git-b4259c0f',
28 info git   '/var/folders/g9/3z4g_fqs5z5_w73rc09lkb0w0000gn/T/npm-21832-93e8ecce/git-cache-04482398/25a23c1fc3743b5b205d70e27f379c6045752783' ]
29 verbose cloneResolved git+https://github.com/zanechua/videojs-sublime-inspired-skin.git clone Cloning into '/var/folders/g9/3z4g_fqs5z5_w73rc09lkb0w0000gn/T/npm-21832-93e8ecce/git-cache-04482398/25a23c1fc3743b5b205d70e27f379c6045752783'...
29 verbose cloneResolved done.
30 info git [ 'checkout', '25a23c1fc3743b5b205d70e27f379c6045752783' ]
31 verbose checkoutTreeish git+https://github.com/zanechua/videojs-sublime-inspired-skin.git checkout Note: checking out '25a23c1fc3743b5b205d70e27f379c6045752783'.
31 verbose checkoutTreeish
31 verbose checkoutTreeish You are in 'detached HEAD' state. You can look around, make experimental
31 verbose checkoutTreeish changes and commit them, and you can discard any commits you make in this
31 verbose checkoutTreeish state without impacting any branches by performing another checkout.
31 verbose checkoutTreeish
31 verbose checkoutTreeish If you want to create a new branch to retain commits you create, you may
31 verbose checkoutTreeish do so (now or later) by using -b with the checkout command again. Example:
31 verbose checkoutTreeish
31 verbose checkoutTreeish   git checkout -b <new-branch-name>
31 verbose checkoutTreeish
31 verbose checkoutTreeish HEAD is now at 25a23c1... Regression fix for Minified CSS
32 info git [ 'submodule', '-q', 'update', '--init', '--recursive' ]
33 verbose updateSubmodules git+https://github.com/zanechua/videojs-sublime-inspired-skin.git submodule update
34 error addLocal Could not install /var/folders/g9/3z4g_fqs5z5_w73rc09lkb0w0000gn/T/npm-21832-93e8ecce/git-cache-04482398/25a23c1fc3743b5b205d70e27f379c6045752783
35 silly fetchPackageMetaData Error: EISDIR: illegal operation on a directory, read
35 silly fetchPackageMetaData     at Error (native)
35 silly fetchPackageMetaData  error for https://github.com/zanechua/videojs-sublime-inspired-skin.git { Error: EISDIR: illegal operation on a directory, read
35 silly fetchPackageMetaData     at Error (native) errno: -21, code: 'EISDIR', syscall: 'read' }
36 silly rollbackFailedOptional Starting
37 silly rollbackFailedOptional Finishing
38 silly runTopLevelLifecycles Finishing
39 silly install printInstalled
40 verbose stack Error: EISDIR: illegal operation on a directory, read
40 verbose stack     at Error (native)
41 verbose cwd /Users/huangzhenjun/Public/Git/PartTime/x-video
42 error Darwin 16.7.0
43 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--save" "https://github.com/zanechua/videojs-sublime-inspired-skin.git"
44 error node v6.9.1
45 error npm  v3.10.8
46 error code EISDIR
47 error errno -21
48 error syscall read
49 error eisdir EISDIR: illegal operation on a directory, read
50 error eisdir This is most likely not a problem with npm itself
50 error eisdir and is related to npm not being able to find a package.json in
50 error eisdir a package you are trying to install.
51 verbose exit [ -21, true ]

2 个答案:

答案 0 :(得分:2)

videojs-sublime-inspired-skin repo没有package.json文件。 Npm需要安装该软件包的package.json文件。这是你应该解决的第一个问题。

如果您是此repo的所有者,则可以通过以下方式添加包文件(在repo目录中)

  

npm init

将package.json文件添加到此repo后,您应该运行如下命令:

  

npm install git + https://github.com/zanechua/videojs-sublime-inspired-skin.git --save

此页面上的安装方法和示例的其他示例。

https://docs.npmjs.com/cli/install

希望这个帮助

答案 1 :(得分:0)

您是否同时运行多个npm安装? npm并不喜欢这样,因为它分配了一个临时工作区,路径表明它在这里发现了一个问题。

另一个选择是你有腐败,你可以做npm rebuild或只是rm -rf node_modulesnpm install这可能会解决它