sequelize / cli

The Sequelize CLI
MIT License
2.53k stars 526 forks source link

Unable to resolve sequelize package #119

Closed edemauro closed 9 years ago

edemauro commented 9 years ago

Hello,

I'm receiving the following error after running npm install -g sequelize-cli:

Unable to resolve sequelize package

Tried removing everything and reinstalling. I then removed everything and tried installing locally instead. Ran it locally with node_modules/.bin/sequelize help:init, but I'm still getting the same error:

Unable to resolve sequelize package

edemauro commented 9 years ago

In case anyone runs into the same issue, I fixed it by installing sequelize and mysql as well.

sdepold commented 9 years ago

Yes. This is "normal" the CLI will try to find the sequelize package in your current working directory and/or in the node paths. So you could either install the package in your local dir or in any parent directory or in the global space.

rfink commented 9 years ago

This is now broken in my mac and production docker deployment (0.12.7-slim container) when installing globally.

sdepold commented 9 years ago

I was almost expecting something like this T_T

phodal commented 9 years ago

Hi @sdepold , I also have this issue, it broken my CI.. https://travis-ci.org/phodal/lan just now.

But in last day, everything work fine.

sdepold commented 9 years ago

I'm sorry. See #175

sdepold commented 9 years ago

Should be fixed in 1.8.3

rfink commented 9 years ago

Wow, super fast response and great fix. Thanks!

richmarr commented 8 years ago

I just bumped into this same symptom. Yesterday my CI system started breaking with this same error. It's been working for months uninterrupted and I haven't made any changes. Could there have been a regression?

richmarr commented 8 years ago

I managed to fix my problem temporarily, by changing my CI config from this:

- npm install sequelize-cli -g
- sequelize db:migrate

to this:

- npm install sequelize-cli
- ./node_modules/sequelize-cli/bin/sequelize db:migrate

According to my CI logs that change worked from Sunday 14th Nov --> Friday 20th Nov, but some time between then and Wednesday 25th Nov it stopped working again, and my CI is b0rked with the error:

Unable to resolve sequelize package

This config doesn't work:

- npm install sequelize-cli
- npm install sequelize-cli -g
- ./node_modules/sequelize-cli/bin/sequelize db:migrate

This config doesn't work either:

- npm install sequelize-cli
- npm install sequelize-cli -g
- sequelize db:migrate

In both cases the npm install log looks fine.

Any ideas?

shellandbull commented 8 years ago

I have the same issue as @richmarr

karloespiritu commented 7 years ago

I encountered the same problem. I was able to fix it by installing sequelize package locally as well:

npm install --save sequelize
richmarr commented 7 years ago

@karloespiritu can you check if it was the same version of sequelize... and I guess umzug as well?

imdzeeshan commented 5 years ago

we should install both sequelize and sequelize-cli to use sequelize-cli.

yujiangshui commented 5 years ago

@imdzeeshan thanks, I misunderstand the tip Unable to resolve sequelize package in xxx especially after running the sequelize command. I thought I didn't install sequelize-cli successfully. Maybe Unable to resolve the 'sequelize' npm package in xxx will be better 😄

HumBerTofGonCalVes commented 4 years ago

Hello guys, I wasn't able to install sequelize also.

This worked for me:

npm cache clean --force npm update

fuadnafiz98 commented 4 years ago

âš  creating .sequelizerc file solves the problem for me

~/.sequelizerc

const path = require("path");

module.exports = {
  config: path.resolve("./src/database/config", "config.js"),
  "models-path": path.resolve("./src/database/models"),
  "seeders-path": path.resolve("./src/database/seeders"),
  "migrations-path": path.resolve("./src/database/migrations"),
};