我已将Titanium安装到我的Mac上,现在当我尝试全局安装任何npm软件包时,它都会失败。
我安装的输出是
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)
当我随后执行哪个grunt-init时,不会返回任何内容。似乎Titanium的一部分干扰了我的-g npm install?
自从我安装Titanium以来,这才开始发生。如果我在npm目录中手动安装grunt-init,我可以使它工作,但这实际上为我带走了最好的功能。
请帮忙!
答案 0 :(得分:20)
尝试输入:
npm set prefix /usr/local
然后重新安装。