2015-06-03 83 views
1

我使用了sails js後端和前端angularjs。我給了npm安裝。 NPM安裝包 顯示此錯誤:帶有angularjs npm的Sailsjs安裝錯誤

npm ERR! peerinvalid The package grunt does not satisfy its siblings' peerDependencies requirements! 
npm ERR! peerinvalid Peer [email protected] wants [email protected]~0.4.0 
npm ERR! peerinvalid Peer [email protected] wants [email protected]>=0.4.0 
npm ERR! peerinvalid Peer [email protected] wants [email protected]>=0.4.0 
npm ERR! peerinvalid Peer [email protected] wants [email protected]>=0.4.0 
npm ERR! peerinvalid Peer [email protected] wants [email protected]>=0.4.0 
npm ERR! peerinvalid Peer [email protected] wants [email protected]~0.4.0 
npm ERR! peerinvalid Peer [email protected] wants [email protected]^0.4.0 
npm ERR! peerinvalid Peer [email protected] wants [email protected]~0.4.0 
npm ERR! peerinvalid Peer [email protected] wants [email protected]>=0.4.0 
npm ERR! peerinvalid Peer [email protected] wants [email protected]>=0.4.0 
npm ERR! peerinvalid Peer [email protected] wants [email protected]~0.4.0 
npm ERR! peerinvalid Peer [email protected] wants [email protected]~0.4.0 
npm ERR! peerinvalid Peer [email protected] wants [email protected]~0.4.5 

packagejson文件:

"dependencies": { 
    "ejs": "~0.8.4", 
    "fs-extra": "^0.12.0", 
    "grunt": "0.4.2", 
    "grunt-contrib-clean": "~0.5.0", 
    "grunt-contrib-coffee": "~0.10.1", 
    "grunt-contrib-concat": "~0.3.0", 
    "grunt-contrib-copy": "~0.5.0", 
    "grunt-contrib-cssmin": "~0.9.0", 
    "grunt-contrib-jst": "~0.6.0", 
    "grunt-contrib-less": "0.11.1", 
    "grunt-contrib-requirejs": "^0.4.4", 
    "grunt-contrib-sass": "^0.8.1", 
    "grunt-contrib-uglify": "~0.4.0", 
    "grunt-contrib-watch": "~0.5.3", 
    "grunt-html2js": "^0.2.9", 
    "grunt-ng-annotate": "*", 
    "grunt-sails-linker": "~0.9.5", 
    "grunt-sync": "~0.0.4", 
    "include-all": "~0.1.3", 
    "lodash": "^2.4.1", 
    "rc": "~0.5.0", 
    "sails": "~0.10.5", 
    "sails-disk": "~0.10.0" 
    }, 

如何解決呢?誰能幫我?

回答

1

似乎你的grunt-ng-annotate要求grunt至少爲0.4.5你有0.4.2嘗試在你的package.json中手動更改版本。它應該工作。

試試這個:

"dependencies": { 
    "ejs": "~0.8.4", 
    "fs-extra": "^0.12.0", 
    "grunt": "0.4.5", 
    "grunt-contrib-clean": "~0.5.0", 
    "grunt-contrib-coffee": "~0.10.1", 
    "grunt-contrib-concat": "~0.3.0", 
    "grunt-contrib-copy": "~0.5.0", 
    "grunt-contrib-cssmin": "~0.9.0", 
    "grunt-contrib-jst": "~0.6.0", 
    "grunt-contrib-less": "0.11.1", 
    "grunt-contrib-requirejs": "^0.4.4", 
    "grunt-contrib-sass": "^0.8.1", 
    "grunt-contrib-uglify": "~0.4.0", 
    "grunt-contrib-watch": "~0.5.3", 
    "grunt-html2js": "^0.2.9", 
    "grunt-ng-annotate": "*", 
    "grunt-sails-linker": "~0.9.5", 
    "grunt-sync": "~0.0.4", 
    "include-all": "~0.1.3", 
    "lodash": "^2.4.1", 
    "rc": "~0.5.0", 
    "sails": "~0.10.5", 
    "sails-disk": "~0.10.0" 
    },