我有一个使用NPM作为包管理器的AngularJS项目。我在两台不同的PC(Ubuntu 16.0.4 OS)中都有该项目的副本。
当我在两台PC上运行npm ls
命令来检查软件包的版本时,某些软件包会给出不同的版本。
当package.json相同时怎么办?
如何解决这个问题?
这是我的package.json:
{
"name": "dashboard",
"version": "0.0.0",
"dependencies": {
"adm-zip": "~0.4.7",
"aws-sign2": "~0.6.0",
"bl": "~1.0.0",
"caseless": "~0.11.0",
"config-chain": "~1.1.9",
"extend": "~3.0.0",
"forever-agent": "~0.6.1",
"form-data": "~0.2.0",
"fs-extra": "~0.26.3",
"har-validator": "~2.0.3",
"hawk": "~3.1.2",
"http-signature": "~1.1.0",
"inherits": "~2.0.1",
"ini": "~1.3.4",
"is-typedarray": "~1.0.0",
"json-stringify-safe": "~5.0.1",
"kew": "~0.7.0",
"mime-types": "~2.1.8",
"node-sass": "^3.4.2",
"nopt": "~3.0.6",
"npmconf": "~2.1.2",
"once": "~1.3.3",
"osenv": "~0.1.3",
"qs": "~6.0.1",
"request": "~2.67.0",
"request-progress": "~0.4.0",
"semver": "~5.1.0",
"socket.io": "~1.3.7",
"source-map": "~0.5.3",
"source-map-support": "~0.4.0",
"stringstream": "0.0.5",
"tough-cookie": "~2.2.1",
"typescript": "1.7.5",
"uid-number": "0.0.6",
"which": "~1.2.0",
"zeparser": "0.0.7"
},
"scripts": {
"test": "gulp test"
},
"devDependencies": {
"bower-nexus3-resolver": "~1.0.1",
"browser-sync": "~2.7.12",
"browser-sync-spa": "~1.0.2",
"chalk": "~1.0.0",
"concat-stream": "~1.5.0",
"del": "~1.2.0",
"gulp": "~3.9.0",
"gulp-angular-templatecache": "~1.6.0",
"gulp-autoprefixer": "~2.3.1",
"gulp-concat": "~2.5.2",
"gulp-csso": "~1.0.0",
"gulp-debug": "~3.1.0",
"gulp-filter": "~2.0.2",
"gulp-flatten": "~0.0.4",
"gulp-inject": "~1.3.1",
"gulp-jshint": "~1.11.0",
"gulp-load-plugins": "~0.10.0",
"gulp-minify-html": "~1.0.3",
"gulp-ng-annotate": "~1.0.0",
"gulp-protractor": "~1.0.0",
"gulp-rename": "~1.2.2",
"gulp-replace": "~0.5.3",
"gulp-rev": "~5.0.0",
"gulp-rev-replace": "~0.4.2",
"gulp-sass": "~2.0.4",
"gulp-scss-lint": "~0.4.0",
"gulp-size": "~1.2.1",
"gulp-sourcemaps": "~1.5.2",
"gulp-tslint": "~2.0.0",
"gulp-typescript": "~2.8.1",
"gulp-typings": "~2.0.3",
"gulp-uglify": "~1.2.0",
"gulp-useref": "~1.2.0",
"gulp-util": "~3.0.5",
"http-proxy-middleware": "~0.0.5",
"jshint-stylish": "~2.0.0",
"karma": "~0.12.36",
"karma-htmlfile-reporter": "~0.2.2",
"karma-jasmine": "~0.3.5",
"karma-ng-html2js-preprocessor": "~0.1.2",
"karma-phantomjs-launcher": "~0.2.0",
"karma-sinon": "~1.0.4",
"lodash": "~3.9.3",
"main-bower-files": "~2.8.0",
"merge-stream": "~0.1.7",
"require-dir": "~0.3.0",
"sinon": "~1.16.1",
"typescript": "1.7.5",
"uglify-save-license": "~0.4.1",
"wiredep": "~2.2.2",
"wrench": "~1.5.8"
},
"engines": {
"node": ">=0.10.0"
}
}
修改
两台PC上的节点版本相同