我有一个旧项目,其中有一个package.json,其中有Dependencies和DevDependecies以及cordovaPlugins定义(Ionic Project)。当我使用npm install时,我得到的错误只是警告,没有描述,没有存储库字段和无效的名称。
这是npm install -ddd:
的输出 npm info it worked if it ends with ok
npm verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
npm verb cli 'C:\\Users\\MAG\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
npm verb cli '-ddd',
npm verb cli 'install' ]
npm info using npm@3.10.9
npm info using node@v4.6.1
npm sill loadCurrentTree Starting
npm sill install loadCurrentTree
npm sill install readLocalPackageData
npm sill install normalizeTree
npm sill loadCurrentTree Finishing
npm sill loadIdealTree Starting
npm sill install loadIdealTree
npm sill cloneCurrentTree Starting
npm sill install cloneCurrentTreeToIdealTree
npm sill cloneCurrentTree Finishing
npm sill loadShrinkwrap Starting
npm sill install loadShrinkwrap
npm sill loadShrinkwrap Finishing
npm sill loadAllDepsIntoIdealTree Starting
npm sill install loadAllDepsIntoIdealTree
npm sill loadAllDepsIntoIdealTree Finishing
npm sill loadIdealTree Finishing
npm sill currentTree ionic
npm sill idealTree ionic
npm sill generateActionsToTake Starting
npm sill install generateActionsToTake
npm sill generateActionsToTake Finishing
npm sill diffTrees action count 0
npm sill decomposeActions action count 0
npm sill runTopLevelLifecycles Starting
npm sill install runPreinstallTopLevelLifecycles
npm sill preinstall ionic C:\Users\MAG\Documents\app\trunk\amp-app\ionic\ionic-82edf1f0
npm info lifecycle undefined~preinstall: undefined
npm sill lifecycle undefined~preinstall: no script for preinstall, continuing
npm sill executeActions Starting
npm sill install executeActions
npm sill doSerial global-install 0
npm sill doParallel fetch 0
npm verb correctMkdir C:\Users\MAG\AppData\Roaming\npm-cache\_locks correctMkdir not in flight; initializing
npm verb lock using C:\Users\MAG\AppData\Roaming\npm-cache\_locks\staging-2e8b4ab8cc917933.lock for C:\Users\MAG\Documents\app\trunk\amp-app\ionic\node_modules\.staging
npm sill doParallel extract 0
npm sill doParallel preinstall 0
npm sill doReverseSerial remove 0
npm sill doSerial move 0
npm sill doSerial finalize 0
npm sill doSerial build 0
npm sill doSerial global-link 0
npm sill doParallel update-linked 0
npm sill doSerial install 0
npm sill doSerial postinstall 0
npm verb unlock done using C:\Users\MAG\AppData\Roaming\npm-cache\_locks\staging-2e8b4ab8cc917933.lock for C:\Users\MAG\Documents\app\trunk\amp-app\ionic\node_modules\.staging
npm sill executeActions Finishing
npm sill rollbackFailedOptional Starting
npm sill rollbackFailedOptional Finishing
npm sill install runPostinstallTopLevelLifecycles
npm sill build ionic
npm info linkStuff !invalid#1
npm sill linkStuff !invalid#1 has C:\Users\MAG\Documents\app\trunk\amp-app as its parent node_modules
npm verb linkBins !invalid#1
npm verb linkMans !invalid#1
npm sill install ionic C:\Users\MAG\Documents\app\trunk\amp-app\ionic\ionic-82edf1f0
npm info lifecycle undefined~install: undefined
npm sill lifecycle undefined~install: no script for install, continuing
npm sill postinstall ionic C:\Users\MAG\Documents\app\trunk\amp-app\ionic\ionic-82edf1f0
npm info lifecycle undefined~postinstall: undefined
npm sill lifecycle undefined~postinstall: no script for postinstall, continuing
npm sill prepublish ionic C:\Users\MAG\Documents\app\trunk\amp-app\ionic\ionic-82edf1f0
npm info lifecycle undefined~prepublish: undefined
npm sill lifecycle undefined~prepublish: no script for prepublish, continuing
npm sill runTopLevelLifecycles Finishing
npm sill install printInstalled
npm WARN Invalid name: "active mobile"
npm verb
npm verb If you need help, you may report this error at:
npm verb <https://github.com/npm/npm/issues>
npm WARN ionic No description
npm verb
npm verb If you need help, you may report this error at:
npm verb <https://github.com/npm/npm/issues>
npm WARN ionic No repository field.
npm verb
npm verb If you need help, you may report this error at:
npm verb <https://github.com/npm/npm/issues>
npm WARN ionic No README data
npm verb
npm verb If you need help, you may report this error at:
npm verb <https://github.com/npm/npm/issues>
npm WARN ionic No license field.
npm verb
npm verb If you need help, you may report this error at:
npm verb <https://github.com/npm/npm/issues>
npm verb exit [ 0, true ]
npm info ok
我得到一个node_modules文件夹,但它是空的。可以是节点版吗?使用4. *。如果是,我怎么知道,我应该使用哪个Node或NPM版本?
答案 0 :(得分:0)
问题出在package.json文件中,请包括然后才能有更好的响应。
我有一些想法。
1)日志说:
npm WARN Invalid name: "active mobile"
你检查你的package.json中是否存在?
2)您可以尝试清理npm缓存
npm cache clean
升级npm版本,存在很多方法取决于您的系统,npm Troubleshooting page
中的更多信息3)您可以在机器中更新cordova和ionic的一般版本。前段时间我有类似的问题,解决方案是更新cordova。
npm update -g cordova ionic
4)您可以安装nvm,这是更改节点版本的简便方法,并检查您的某个模块是否需要特定版本的节点。