Adapter is not compatible with the current version of Sails - node.js

I am not able to run sails js project on my UBUNTU machine i've sails 0.10.5 and the below is the error i am getting
ahsan#ahsan-Inspiron-N5110:~/Desktop/CardCashP2/Website$ sails lift
info: Starting app...
warn: `sails.config.express` is deprecated; use `sails.config.http` instead.
warn: The adapter `sails-disk` appears to be designed for an earlier version of Sails.
warn: (it has a `registerCollection()` method.)
warn: Since you're running Sails v0.10.x, it probably isn't going to work.
warn: To attempt to install the updated version of this adapter, run:
warn: npm install sails-disk#0.10.x
error: There was an error attempting to require("sails-disk")
error: Is this a valid Sails/Waterline adapter? The following error was encountered ::
error: Adapter is not compatible with the current version of Sails.
ahsan#ahsan-Inspiron-N5110:~/Desktop/CardCashP2/Website$
my package.json file is:
{
"name": "",
"private": true,
"version": "0.0.0",
"description": "a Sails application",
"dependencies": {
"MD5": "1.2.1",
"autocomplete": "0.0.1",
"convert-json": "^0.4.0",
"cron": "^1.0.5",
"download": "^0.1.18",
"ejs": "0.8.4",
"emailjs": "^0.3.8",
"express": "^4.9.8",
"grunt": "0.4.1",
"ipv6": "^3.1.1",
"js-combinatorics": "^0.4.0",
"mkdirp": "^0.5.0",
"moment": "^2.9.0",
"mysql": "2.2.0",
"nodemailer": "0.6.3",
"optimist": "0.3.4",
"pagination": "^0.4.3",
"payment-paypal-payflowpro": "0.0.4",
"paynode": "^0.3.6",
"paypal-rest-sdk": "^1.0.0",
"pdfkit": "0.6.2",
"request": "2.34.0",
"request-json": "0.4.10",
"sails": "0.9.13",
"sails-disk": "~0.9.0",
"sequelize": "1.7.3",
"wkhtmltopdf": "^0.1.4",
"xlsjs": "^0.7.1"
},
"scripts": {
"start": "node app.js",
"debug": "node debug app.js"
},
"main": "app.js",
"repository": "",
"author": "",
"license": ""
}
i don't know what is happening and I've already burned penalty of hours doing R&D and fixing it
please help me get rid of this.
Sails and Node versions are:
ahsan#ahsan-Inspiron-N5110:~/Desktop/CardCashP2/Website$ sails --version
0.10.5
ahsan#ahsan-Inspiron-N5110:~/Desktop/CardCashP2/Website$ node --version
v0.10.35
Thanks

Your sails version is 0.10.5 but the sails-disk version specified in your package.json is "sails-disk": "~0.9.0",.
You should update your sails-disk to the latest version. Here's how:
In package.json:
Change "sails-disk": "~0.9.0", to "sails-disk": "*",. Save the file.
Now, run npm update --save.
This will update your sails-disk (probably to "sails-disk": "~0.10.0",) and also set that version in package.json.
Now try sails lift. Good luck !
PS. You should do the same for sails as that version is also not in sync with the installed version.

Update the version of sails-disk
For the version Sails 1 , "sails-disk": "^1.0.1" works.
npm remove --save sails-disk
npm install --save sails-disk

Related

Error: Cannot find module '#heroku/buildpack-registry'

I am trying to deploy a web app on Heroku. I am getting the following error
Error: Cannot find module '#heroku/buildpack-registry'
I tried adding the version of node I am using but still didn't help.
I also upgraded Heroku using npm i heroku#7.59.0 this too didn't help.
Any thoughts on this?
This is my package.json
{"name":"gssrDB",
"engines": {
"node": "14.18.0"
}
,
"scripts": {
"dev": "nodemon index.js",
"start": "node index.js"
},
"dependencies": {
"#heroku-cli/plugin-buildpacks": "^7.54.0",
"#heroku/buildpack-registry": "^1.0.1",
"async-file": "^2.0.2",
"cli-ux": "^4.9.3",
"dotenv": "^9.0.2",
"ejs": "^3.1.6",
"ejs-mate": "^3.0.0",
"express": "^4.17.1",
"got": "^8.3.2",
"heroku": "^7.59.0",
"mongodb": "^3.6.6",
"mongoose": "^5.12.9",
"nodemon": "^2.0.13",
"phoenix": "^1.6.0"
}
}
I solved it like this in terminal
$ heroku plugins:install buildpack-registry
$ heroku plugins:install buildpacks
may be it works
I faced a similar problem, and I solved it by using proper node version.
For the current heroku version, node16 works, otherwise it cause error in buildpack
Two things helped in fixing this:
update the heroku CLI
npm install -g heroku
Adding the engines in the package.json with the currently installed node and npm versions
"node": "14.18.0",
"npm": "7.6.3"
}

npm ERR! Cannot read property 'pause' of undefined --Bluemix

I am trying to deploy a Sails.js app to Bluemix and we are getting the following error during the deploy stage in the toolchain on Bluemix (When the CF PUSH command is called):
npm ERR! Cannot read property 'pause' of undefined
I understand the trace goes to the npm-error.log file, however, I haven't been able to get to it as we cannot ssh in to see whats in the file as the application is in its "off" state after a bad deploy.
This same code was successfully deployed with both Cf push {app name}} and through a simple build and deploy toolchain in Bluemix just 8 days ago.
In the build stage I can run Npm install and npm update just fine. However, it seems to do this again in the deploy stage regardless and it fails. Here is some detail on this failure
NODE_ENV=production
NPM_CONFIG_LOGLEVEL=error
NPM_CONFIG_PRODUCTION=true
Visit http://docs.cloudfoundry.org/buildpacks/node/index.html#vendoring
NODE_HOME=/tmp/app/.cloudfoundry/0/node
NODE_MODULES_CACHE=true
NODE_VERBOSE=false
Restoring cache
Loading 3 from cacheDirectories (default):
- .npm
- .cache/yarn (not cached - skipping)
- bower_components (not cached - skipping)
Installing node modules (package.json) Building dependencies
sails#0.12.13 preinstall /tmp/app/node_modules/sails
node ./lib/preinstall_npmcheck.js
Sails.js Installation: Checking npm-version successful
npm ERR! Cannot read property 'pause' of undefined
npm ERR! /tmp/app/.npm/_logs/2017-09-09T17_02_48_660Z-debug.log
**ERROR** Unable to build dependencies: exit status 1
Failed to compile droplet
Exit status 223
Staging failed: Exited with status 223
Destroying container
npm ERR! A complete log of this run can be found in:
Successfully destroyed container
Package.json file
{
"name": "myApp",
"private": true,
"version": "0.0.1",
"description": "Stuff my app does",
"keywords": [
"Cool Apps"
],
"dependencies": {
"bcryptjs": "^2.4.3",
"cacheman": "^2.2.1",
"ejs": "2.3.4",
"elasticsearch": "^13.0.0-rc2",
"find-remove": "^1.0.1",
"fs": "0.0.1-security",
"grunt": "1.0.1",
"grunt-contrib-clean": "1.0.0",
"grunt-contrib-coffee": "1.0.0",
"grunt-contrib-concat": "1.0.1",
"grunt-contrib-copy": "1.0.0",
"grunt-contrib-cssmin": "1.0.1",
"grunt-contrib-jst": "1.0.0",
"grunt-contrib-less": "1.3.0",
"grunt-contrib-uglify": "1.0.1",
"grunt-contrib-watch": "1.0.0",
"grunt-sails-linker": "~0.10.1",
"grunt-sync": "0.5.2",
"include-all": "^1.0.0",
"jsonwebtoken": "^7.3.0",
"moment": "^2.18.1",
"moment-timezone": "^0.5.13",
"passport": "^0.2.x",
"passport-http-bearer": "^1.0.1",
"passport-idaas-openidconnect": "^1.1.0",
"passport-local": "^1.0.0",
"rc": "1.0.1",
"request": "^2.81.0",
"request-promise": "^4.2.0",
"sails": "~0.12.13",
"sails-disk": "~0.10.9",
"sails-mongo": "^0.12.2",
"stream": "0.0.2",
"uuid-1345": "^0.99.6",
"validator": "^7.0.0",
"natural-sort": "^1.0.0"
},
"scripts": {
"start": "node app.js"
},
"engines": {
"node": "^8.0.x",
"npm": "^5.0.x"
},
"main": "app.js",
"author": "Scott N",
"license": ""
}
Things I've tried so far.
-change node versions
-changed npm versions
-change dependencies versions to include the ^ prefix
-removed all dependencies but Sails in the package.json file
So Sails.js and the Nodebuildpack/Bluemix aren't playing well with each other.
Any help would be appreciated.
Thank you
It happens to me just the same. and I've to roll back the prev version of npm: 5.3.0 and it's working now. (BTW: macOS)
The error only happens when I update my npm version like this:
Update available 5.3.0 → 5.4.1
Run npm i -g npm to update
The best way to handle it is to update your package.json to use engines like so
"description": "a Sails application",
"keywords": [],
"engines": {
"node": "6.10.1",
"npm": "5.3.0"
},
Got this issue while trying to push to heroku which seems to be the npm version specified by #m-t, and also specifying the versions like above makes ibm bluemix pick it up as default node engine instead of using the latest stable version.
And don't forget to always specify your node and npm versions directly, instead of adding tilde or caret, this just to be safe. check https://stackoverflow.com/a/22345808/5836034 for more about tilde and caret
you can still check #sai-vennam answer here for more info
So I rolled back the sails version in the package.json file from 0.12 to 0.11 and it deployed fine. So CF PUSH and the newest sails version are not getting along on Bluemix. This was using Node 8.0 and NPM version ^5.0.x

How to solve the following browserify error?

I'm new to using gulp and browserify. I'm trying to follow a tutorial online which uses browserify and gulp.
Following is my package.json
{
"name": "progressive",
"version": "1.0.0",
"description": "Practcing a Progressive Web App",
"scripts": {
"start": "node ./index.js"
},
"author": "Indu Pillai",
"devDependencies": {
"browserify": "^13.1.0",
"gulp": "^3.8.8",
"gulp-browserify": "^0.5.1",
"gulp-clean-css": "^2.0.13",
"gulp-concat-css": "^2.3.0",
"gulp-if": "^2.0.1",
"gulp-sourcemaps": "^2.2.0",
"gulp-uglify": "^2.0.0",
"gulp-util": "^2.2.20",
"gulp-webserver": "^0.8.8",
"jquery": "^3.1.1",
"sw-precache": "^4.2.1"
},
"dependencies": {
"handlebars": "^4.0.5"
}
}
When I run npm install, it gives me the following error:
npm WARN browserify-shim#2.0.10 requires a peer of browserify#>= 2.3.0 < 4 but none was installed.
I don't know how to solve this problem, I'm not good at npm stuff either. I didn't ask for browserify-shim in my package.json, but may be some of the packages I asked depends on it.
Thank You!
I have the same problem
and I solve it with the following:
If you use the windows you should
Download the :(Windows Binary.Zip)
Then choose the correct architecture to your computer (32 or 64),
make it active
Open Command Prompt as Administrator
Execute this on the command line: npm install -g #angular/cli

Why does `npm install` hang with this specific `package.json`?

When trying to npm install this exact package.json, npm hangs and becomes totally unreponsive.
{
"name": "My Project",
"description": "My Project",
"version": "1.0.0",
"private": true,
"main": "server.js",
"dependencies": {
"body-parser": "^1.15.2",
"compression": "^1.6.2",
"cors": "^2.8.0",
"loopback": "^2.31.0",
"loopback-boot": "^2.21.0",
"loopback-component-explorer": "^2.5.0",
"loopback-connector-mysql": "^2.3.0",
"loopback-connector-redis": "^0.0.3",
"loopback-datasource-juggler": "^2.50.0",
"loopback-ds-timestamp-mixin": "^3.4.0",
"mosca": "^2.1.0",
"mqtt": "^1.14.1",
"q": "^1.4.1",
"redis": "^2.6.2",
"serve-favicon": "^2.3.0",
"socket.io": "^1.4.8",
"socketio-auth": "0.0.5"
},
"devDependencies": {
"grunt": "^1.0.1",
"grunt-contrib-concat": "^1.0.1",
"grunt-contrib-jshint": "^1.0.0",
"grunt-contrib-uglify": "^2.0.0",
"grunt-docular": "^0.2.4",
"grunt-loopback-sdk-angular": "^1.2.0",
"jshint": "^2.9.3"
},
"scripts": {
"start": "node .",
"pretest": "jshint ."
}
}
I tested this on different clients, both using npm version 3.10.6 and node v6.5.0. I'm pretty sure it worked some days ago, but now, it just refuses to complete. I tried npm cache clean, tried lowering maxsockets down to 1, waiting for 20-30 minutes and tried to remove packages from packages.json, but finding the culprit it's a hit and miss. For example, "mosca" alone makes npm hang, but even when removed from package.json, it still won't finish.
The last message I see it's:
[ .....] - extract:socketio-auth: sill doParallel extract 852
and then just nothing. It doesn't give any error, even when setting logging level to silly. It just hangs forever. I really don't understand and I'm pretty sure it was working some day ago. Can someone help me? Does this package.json work for you?
I already checked this,this and this, but I think it's not related to them.
I't a known npm bug, still open... :-(
I'd rollback npm to 6.4 (which is #13782 bug free), till it's fixed...

MarkLogic npm issues

I'm having issue while I'm installing MarkLogic. When I execute the command
npm install marklogic --save
I'm getting an error. It says
Refusing to install marklogic as a dependency of itself
package.json:
{
"name": "marklogic",
"version": "0.0.0",
"private": true,
"scripts": {
"start": "node ./bin/www"
},
"dependencies": {
"body-parser": "~1.15.1",
"cookie-parser": "~1.4.3",
"debug": "~2.2.0",
"express": "~4.13.4",
"jade": "~1.11.0",
"morgan": "~1.7.0",
"serve-favicon": "~2.3.0"
}
}
Checking -- if you cloned the MarkLogic Node.js API project, then ran the npm install command that you show above, I'd expect to see this error. Is that what's happening?
Edit: elevating #grtjn's point from the comment: When selecting a name for your package, it has to be unique. "marklogic" is the name of an existing package, and therefore conflicted with the same name used for the package you were building.

Resources