NPM install -g 在 Titanium 安装后不起作用 [英] NPM install -g not working after Titanium install

查看:68
本文介绍了NPM install -g 在 Titanium 安装后不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在我的 mac 上安装了 Titanium,现在每当我尝试全局安装任何 npm 包时,它都会失败.

I have installed Titanium onto my mac and now when ever I try to globally install any npm packages it fails.

我安装的输出是

npm http 304 https://registry.npmjs.org/loggly
npm http GET https://registry.npmjs.org/underscore
npm http GET https://registry.npmjs.org/timespan
npm http GET https://registry.npmjs.org/request
npm http 304 https://registry.npmjs.org/underscore
npm http 304 https://registry.npmjs.org/request
npm http 304 https://registry.npmjs.org/timespan
/Applications/Titanium Studio/TitaniumStudio.app/Contents/MacOS/Password:/usr/local/share/npm/bin/grunt-init -> /Applications/Titanium Studio/TitaniumStudio.app/Contents/MacOS/Password:/usr/local/share/npm/lib/node_modules/grunt-init/bin/grunt-init
grunt-init@0.2.1 /Applications/Titanium Studio/TitaniumStudio.app/Contents/MacOS/Password:/usr/local/share/npm/lib/node_modules/grunt-init
├── semver@1.0.14
├── colors@0.6.2
├── hooker@0.2.3
├── grunt@0.4.1 (which@1.0.5, dateformat@1.0.2-1.2.3, eventemitter2@0.4.13, async@0.1.22, lodash@0.9.2, coffee-script@1.3.3, underscore.string@2.2.1, findup-sync@0.1.2, iconv-lite@0.2.11, nopt@1.0.10, rimraf@2.0.3, minimatch@0.2.12, glob@3.1.21, js-yaml@2.0.5)
└── prompt@0.1.12 (async@0.1.22, pkginfo@0.3.0, winston@0.5.11)

当我随后执行 which grunt-init 时,没有返回任何内容.似乎是 Titanium 的一部分干扰了我的 -g npm install?

When I then subsequently do which grunt-init, nothing is returned. It seems like something which is part of Titanium is interfering with my -g npm install?

这只是在我安装 Titanium 后才开始发生.如果我在 npm 目录中手动安装 grunt-init ,我可以让它工作,但这实际上带走了我最好的功能.

This only started happening since I installed Titanium. I can get it working if I manually install grunt-init in the npm directory, but this has literally taken away the best feature for me.

请帮忙!

推荐答案

尝试输入:

npm set prefix /usr/local

然后重新安装.

这篇关于NPM install -g 在 Titanium 安装后不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆