NPM install -g not working after Titanium install

2019-03-20 04:07发布

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

The output from my install is

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)

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?

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.

please help!

标签: titanium npm
1条回答
一纸荒年 Trace。
2楼-- · 2019-03-20 04:37

Try typing:

npm set prefix /usr/local

Then installing again.

查看更多
登录 后发表回答