安装MobileFirst Platform mfpdev-cli的节点错误

时间:2017-10-06 19:44:42

标签: node.js ibm-mobilefirst command-line-interface npm-install

您好我安装mfpdev-cli时出错。

我在Node中运行:

npm install -g mfpdev-cli

另外,我试过了:

npm install -g --no-optional mfpdev-cli

我也有同样的结果:

npm ERR! code ENOLOCAL
npm ERR! Could not install from "..\AppData\Roaming\npm\node_modules\mdo-adapter-actions" as it does not contain a package.json file.

npm ERR! A complete log of this run can be found in:
npm ERR!     ..\AppData\Roaming\npm-cache\_logs\2017-10-06T19_33_40_852Z-debug.log

日志文件:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Users\\admin\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'install',
1 verbose cli   '-g',
1 verbose cli   'mfpdev-cli' ]
2 info using npm@5.4.2
3 info using node@v8.6.0
4 verbose npm-session c592940cb4bd8510
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 http fetch GET 200 https://registry.npmjs.org/mfpdev-cli 17ms (from cache)
8 silly pacote tag manifest for mfpdev-cli@latest fetched in 57ms
9 silly install loadIdealTree
10 silly install cloneCurrentTreeToIdealTree
11 silly install loadShrinkwrap
12 silly install loadAllDepsIntoIdealTree
13 silly resolveWithNewModule mfpdev-cli@8.0.2017092810 checking installable status
14 silly pacote trying https://registry.npmjs.org/mfpdev-cli/-/mfpdev-cli-8.0.2017092810.tgz by hash: sha1-xVC4PO9ZSewF6xzlXsWExVTqvsw=
15 silly pacote https://registry.npmjs.org/mfpdev-cli/-/mfpdev-cli-8.0.2017092810.tgz extracted to C:\Users\ADMIN\AppData\Local\Temp\npm-11192-a75b2045\unpack-1eeac08f by content address 11899ms
16 silly addBundled read tarball
17 silly cleanup remove extracted module
18 silly fetchPackageMetaData error for mdo-adapter-actions@file:..\mdo-adapter-actions Could not install from "C:\Users\admin\AppData\Roaming\npm\node_modules\mdo-adapter-actions" as it does not contain a package.json file.
19 verbose stack Error: ENOENT: no such file or directory, open 'C:\Users\admin\AppData\Roaming\npm\node_modules\mdo-adapter-actions\package.json'
20 verbose cwd H:\
21 verbose Windows_NT 10.0.15063
22 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\admin\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "mfpdev-cli"
23 verbose node v8.6.0
24 verbose npm  v5.4.2
25 error code ENOLOCAL
26 error Could not install from "C:\Users\admin\AppData\Roaming\npm\node_modules\mdo-adapter-actions" as it does not contain a package.json file.
27 verbose exit [ 1, true ]

我的节点版本是8.6.0,NPM版本是5.4.2,操作系统是Windows 10。

我尝试降级版本和清理缓存,但始终是同样的错误。

如何安装IMB MobileFirst Platform CLI?

此问题仅发生在最新版本的mfpdev-cli v8.0.2017090705我尝试了stackoverflow的不同解决方案,但它们对我不起作用。

2 个答案:

答案 0 :(得分:1)

你能分享完整的错误吗?

你应该试试这个:

npm cache clean
npm set registry https://registry.npmjs.org/
npm set registry http://registry.npmjs.org/

npm install -g mfpdev-cli@latest

答案 1 :(得分:1)

由于mfpdev-cli的代码在5小时前更新(https://www.npmjs.com/package/mfpdev-cli),他们似乎注意到了这些错误。

我昨天遇到了同样的错误(甚至在将npm降级到3.10.10和更低版本以及Windows 10和Mac Sierra之后)并且它仍然在两个操作系统中都出现了一些错误,但它终于工作(mfpdev -v 8.0.0-2017101013)。

  • 使用Node -v 6.9.3安装在Windows 10上; npm 3.10.10。
  • 使用Node -v 6.11.4安装在Mac Sierra上; npm 3.10.10。

编辑:

我在两个操作系统中更新了npm到最新版本(5.5.1),安装仍然失败,因此需要降级到3.10.10(如Gaurab Kumar所述)。