grunt-deployments icon indicating copy to clipboard operation
grunt-deployments copied to clipboard

node_modules/search-replace-db/srdb.cli.php: No such file or directory

Open davemac opened this issue 11 years ago • 6 comments

I'm testing the feature/advanced-search-replace branch and when I run:

grunt db_pull --src="production" --dest="local"

I get the following error:

/bin/sh: node_modules/search-replace-db/srdb.cli.php: No such file or directory

From what I can see, is this something to do with scriptPath not having the correct path to srdb.cli.php ?

davemac avatar May 08 '14 07:05 davemac

You'll need to ensure you have the correct dependencies installed. It's look for the script at node_modules/search-replace-db/srdb.cli.php: which you don't have in your filesystem.

Try npm install? Hope that helps?

See this line

https://github.com/getdave/grunt-deployments/blob/feature/advanced-search-replace/package.json#L34

getdave avatar May 09 '14 11:05 getdave

Hi Dave,

Great work on this script, by the way. OK, I think I am missing something.

My local package.json for the site contains:

  "devDependencies": {
    "grunt": "~0.4.2",
    "grunt-autoprefixer": "~0.7.2",
    "grunt-contrib-imagemin": "~0.6.0",
    "grunt-contrib-jshint": "~0.9.2",
    "grunt-contrib-uglify": "^0.4.0",
    "grunt-contrib-watch": "~0.6.1",
    "grunt-rsync": "~0.5.0",
    "matchdep": "~0.3.0",
    "grunt-deployments": "git://github.com/getdave/grunt-deployments.git#feature/advanced-search-replace"
  }

I've run npm install and I can see search-replace-db in my home folder at '~/npm/search-replace-db/2.2.0/package/' but it's not in my local site folder's node-modules which is causing the error, as you said.

Sorry if i've missed something obvious?

davemac avatar May 09 '14 11:05 davemac

OK I've added the following to my DevDepencies:

"Search-Replace-DB": "git://github.com/getdave/Search-Replace-DB#e26fba07b91a8c18aedffc9e277716f5e0d46043"

and that installs the package locally and gets rid of the error. Not sure why I had to explicitly add that line to my package.json when it's referenced in your module?

davemac avatar May 09 '14 13:05 davemac

Hmmmm...this could be an issue. I'm wondering whether the way npm resolves dependencies is going to mean the way Grunt Deployments uses the Search Replace DB script in this somewhat unorthadox manner isn't go to be a goer.

Did you get this working in the end and has it now resolved https://github.com/getdave/grunt-deployments/issues/44 ? Is so can you close the issues?

getdave avatar May 11 '14 21:05 getdave

So the issue here still exists, in that npm installs search-replace-db in to ~/npm rather than into the local site folder. This result in the error as per the ticket.

I got around this by manually adding the dependency to my package.json:

"Search-Replace-DB": "git://github.com/getdave/Search-Replace-DB#e26fba07b91a8c18aedffc9e277716f5e0d46043"

But from what I can see, anyone running npm install on the feature/advanced-search-replace-script will get this issue, unless they manually add the dependency.

davemac avatar May 12 '14 00:05 davemac

#44 is a separate issue.

davemac avatar May 12 '14 00:05 davemac