为了使用 gulp.js 在 Windows 7 上构建前端源,我有一个package.json
文件,其中定义了node_modules
个依赖项:
{
"name": "custom-repo-name",
"version": "1.0.0",
"description": "",
"main": "gulpfile.js",
"directories": {
"doc": "doc"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"gulp-concat": "^2.5.2",
"gulp-stylus": "^2.0.3",
"gulp-uglify": "^1.2.0",
"rimraf": "^2.3.4"
},
"devDependencies": {
"gulp": "^3.9.0",
"gulp-concat": "^2.5.2",
"gulp-rev": "^4.0.0",
"gulp-stylus": "^2.0.3",
"gulp-uglify": "^1.2.0",
"gulp-watch": "^4.2.4",
"rimraf": "^2.3.4"
}
}
出于某种原因我跑
npm install
依赖项本地安装到.\node_modules
文件夹中,gulp
命令正常运行。
但是当我跑步时
npm install -g
,
从输出中可以看出,缺少部分依赖项安装并且运行gulp
命令失败,并且依赖项加载失败(例如gulp-uglify.js)。
出了什么问题?