首页 > 解决方案 > 无法安装sequelize NPM node_modules/.sequelize.DELETE/node_modules/debug

问题描述

我是 NodeJS 的新手,想使用 Sequelize。
我在一个新的 CentOS7 VM 上安装了 PostgreSQL 和 Node。

node -v v10.14.1
npm -v v6.5.0

当我尝试安装sequelize

[vmuser@accounts-1 accounts-nodejs]$ npm install --save sequelize
npm ERR! path /mnt/hgfs/vms_shared/dev/accounts-nodejs/node_modules/.sequelize.DELETE/node_modules/debug
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename '/mnt/hgfs/vms_shared/dev/accounts-nodejs/node_modules/.sequelize.DELETE/node_modules/debug' -> '/mnt/hgfs/vms_shared/dev/accounts-nodejs/node_modules/sequelize/node_modules/debug'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/vmuser/.npm/_logs/2018-12-12T15_42_17_715Z-debug.log

标签: node.jssequelize.js

解决方案


可能是因为你没有 package.json 文件。该--save标志指示 npm 将其保存为 package.json 中的依赖项。因此,首先运行npm init它是一个交互式命令行进程。然后安装sequelize


推荐阅读