Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to resolve sequelize package

I'm trying to install sequelize-cli in my Mac OS 10.12.6.

In Terminal, I did

npm install -g sequelize-cli

I got

npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
/usr/local/bin/sequelize -> /usr/local/lib/node_modules/sequelize-cli/bin/sequelize
/usr/local/lib
└── [email protected] 

Then, I tried

sequelize model:create --name User --attributes name:string,complete:boolean

I got

Unable to resolve sequelize package in /Users/bheng/Sites/BASE

I even try with the --save as this post suggested.

npm install -g sequelize-cli --save

I got same result.

npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
/usr/local/bin/sequelize -> /usr/local/lib/node_modules/sequelize-cli/bin/sequelize
/usr/local/lib
└── [email protected] 

sequelize model:create --name User --attributes name:string,complete:boolean

Unable to resolve sequelize package in /Users/bheng/Sites/BASE

What else should I try ?

like image 290
code-8 Avatar asked Aug 30 '17 23:08

code-8


3 Answers

In sequelize-cli package.json file, sequelize is mentioned as a devdependency which means it does not install it when you do npm install sequelize-cli. My guess is you have not installed sequelize itself and this is what the error says.

Unable to resolve sequelize package in /Users/bheng/Sites/BASE

install sequelize npm install --save sequelize (or global) and things should be good.

PS: Great answer on different dependencies and what they mean

like image 175
AbhinavD Avatar answered Nov 20 '22 12:11

AbhinavD


I had the same issue. I installed sequelize-cli forgetting to add sequelize itself:

npm install sequelize

like image 10
Victor Karangwa Avatar answered Nov 20 '22 13:11

Victor Karangwa


You will need to install sequelize globally.

npm install -g sequelize

like image 2
vendeeshwaran Chandran Avatar answered Nov 20 '22 12:11

vendeeshwaran Chandran