我正在创建一个管理博客帖子的项目(基本上)。我刚刚在云平台上安装了这个,没问题。我只是想清理我的node_modules
文件夹,因此我将其删除并再次安装npm install
。
现在,我不能再安装mongoose,所有不同的模块都可以正常创建。但猫鼬无法安装。它让我发疯了。
这是我得到的错误。
npm ERR! Error: ENOENT, open '/home/petur/Documents/WebProjects/soundMixes/node_modules/mongoose/node_modules/mongodb/package.json'
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-@googlegroups.com>
npm ERR! System Linux 3.13.0-37-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/petur/Documents/WebProjects/soundMixes
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! path /home/petur/Documents/WebProjects/soundMixes/node_modules/mongoose/node_modules/mongodb/package.json
npm ERR! code ENOENT
npm ERR! errno 34
npm http 304 https://registry.npmjs.org/qs
npm http 304 https://registry.npmjs.org/ms/0.6.2
npm ERR! Error: ENOENT, lstat '/home/petur/Documents/WebProjects/soundMixes/node_modules/mongoose/node_modules/hooks/README.md'
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-@googlegroups.com>
npm ERR! System Linux 3.13.0-37-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/petur/Documents/WebProjects/soundMixes
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! path /home/petur/Documents/WebProjects/soundMixes/node_modules/mongoose/node_modules/hooks/README.md
npm ERR! fstream_path /home/petur/Documents/WebProjects/soundMixes/node_modules/mongoose/node_modules/hooks/README.md
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! Error: ENOENT, lstat '/home/petur/Documents/WebProjects/soundMixes/node_modules/mongoose/node_modules/mquery/README.md'
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-@googlegroups.com>
npm ERR! System Linux 3.13.0-37-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/petur/Documents/WebProjects/soundMixes
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! path /home/petur/Documents/WebProjects/soundMixes/node_modules/mongoose/node_modules/mquery/README.md
npm ERR! fstream_path /home/petur/Documents/WebProjects/soundMixes/node_modules/mongoose/node_modules/mquery/README.md
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
这是我的package.json
{
"name": "soundMixes",
"version": "0.0.0",
"description": "a webapp to manage soundmixes",
"main": "Gruntfile.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node server.js"
},
"devDependencies": {
"mongoose" :"",
"grunt": "~0.4.5",
"grunt-cli" : "~0.1.13",
"grunt-contrib-uglify": "~0.6.0",
"grunt-contrib-concat": "~0.5.0",
"grunt-contrib-jshint": "~0.10.0",
"grunt-contrib-watch": "~0.6.1",
"grunt-recess": "~1.0.0",
"grunt-targethtml" : "",
"express" :"",
"mongoose" : "",
"formidable" : "",
"body-parser" : ""
},
"repository": {
"type": "git",
"url": ""
},
"author": "",
"license": "BSD-2-Clause",
"bugs": {
"url": ""
}
}
答案 0 :(得分:0)
您应指定要安装的最新版本的mongoose,而不是将版本留空。
npm install --save mongoose
我还不确定当您需要将它们作为Dev依赖项进行部署时,为什么要将它们安装。