5

通过 npm 安装 mfpdev-cli 时,我收到以下错误:

$ npm install -g mfpdev-cli@latest
npm ERR! addLocal Could not install /usr/local/lib/node_modules/mdo-adapter-actions
npm ERR! addLocal Could not install /usr/local/lib/node_modules/mdo-android-support
npm ERR! addLocal Could not install /usr/local/lib/node_modules/mdo-app-config
npm ERR! addLocal Could not install /usr/local/lib/node_modules/mdo-app-preview
npm ERR! addLocal Could not install /usr/local/lib/node_modules/mdo-app-pull
npm ERR! addLocal Could not install /usr/local/lib/node_modules/mdo-app-push
npm ERR! addLocal Could not install /usr/local/lib/node_modules/mdo-app-register
npm ERR! addLocal Could not install /usr/local/lib/node_modules/mdo-app-webencrypt
npm ERR! addLocal Could not install /usr/local/lib/node_modules/mdo-app-webupdate
npm ERR! addLocal Could not install /usr/local/lib/node_modules/mdo-cmd-adapter
npm ERR! addLocal Could not install /usr/local/lib/node_modules/mdo-cmd-app
npm ERR! addLocal Could not install /usr/local/lib/node_modules/mdo-cmd-config
npm ERR! addLocal Could not install /usr/local/lib/node_modules/mdo-cmd-info
npm ERR! addLocal Could not install /usr/local/lib/node_modules/mdo-cmd-server
npm ERR! addLocal Could not install /usr/local/lib/node_modules/mdo-cordova-support
npm ERR! addLocal Could not install /usr/local/lib/node_modules/mdo-errors
npm ERR! addLocal Could not install /usr/local/lib/node_modules/mdo-exec
npm ERR! addLocal Could not install /usr/local/lib/node_modules/mdo-ios-support
npm ERR! addLocal Could not install /usr/local/lib/node_modules/mdo-browser-support
npm ERR! addLocal Could not install /usr/local/lib/node_modules/mdo-mbs
npm ERR! addLocal Could not install /usr/local/lib/node_modules/mdo-server-support
npm ERR! addLocal Could not install /usr/local/lib/node_modules/mdo-windows-support
npm ERR! addLocal Could not install /usr/local/lib/node_modules/platform-manager
npm ERR! fetch failed https://registry.npmjs.org/ibm-strings/-/ibm-strings-0.1.4.tgz
npm WARN retry will retry, error on last attempt: Error: fetch failed with status code 404
npm ERR! fetch failed https://registry.npmjs.org/mfp-config-xml/-/mfp-config-xml-0.0.3.tgz
npm WARN retry will retry, error on last attempt: Error: fetch failed with status code 404
npm ERR! fetch failed https://registry.npmjs.org/pluggington/-/pluggington-0.3.3.tgz
npm WARN retry will retry, error on last attempt: Error: fetch failed with status code 404

有关如何解决此问题并安装最新版本的 MobileFirst CLI 的任何想法?我在 Mac OS X 10.11.6 上运行 npm 版本 3.10.7,我的节点版本是 4.2.4。

谢谢你的帮助,

约翰

4

3 回答 3

3

来源:https ://portal2portal.blogspot.in/2017/12/ibm-mobilefirst-8-commanding-cli.html

2018 年 5 月, npm install -g mfpdev-cli 仍然无法正常工作,但我已经找到了使其工作的方法。节点版本必须是 7.3.0,npm 版本必须是 3.10.10。

步骤: 1. 将节点降级(或升级)到 7.3.0。复制并粘贴这些命令以删除节点。

$ sudo rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/{npm*,node*,man1/node*}

$ sudo apt autoremove

2. 现在使用 nvm 或 n 或任何你喜欢的方式安装所需版本的 node(7.3.0)。我已经安装了 nvm 所以我用 nvm 做了

$ nvm install 7.3.0

使用此命令 node 和 npm 将自动安装到所需的版本。在运行最终命令之前验证 npm 和节点:

$ npm install -g mfpdev-cli

或者 :

$ sudo npm install -g mfpdev-cli

就我而言,它不适用于 sudo。但它可能适用于你的情况。

功劳归于该链接中的原始海报。赞!

于 2018-05-10T11:44:11.983 回答
3

我遇到过同样的问题。

我检查了我的npm版本,它是3.10.9. 我将其降级为2.14.7,什么解决了我关于404错误的问题。

于 2016-12-29T16:42:32.977 回答
2

事实证明,最新版本的 npm 发生了变化,只有版本 3.10.7 会导致出现此问题。解决方法是将您的 npm 版本回归到 3.10.6。

MobileFirst 开发团队正在着手修复,一旦发生,我将使用该信息更新此答案。

如果您对此有任何疑问,请在下方留言。

谢谢,

约翰·格肯

于 2016-09-12T16:39:39.580 回答