MarkLogic npm issues - node.js

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.

Related

Cannot upgrade Node.js version in Azure App Service

My Azure app service is running Node.js version 0.10:
> node -v
D:\home\site\wwwroot
v0.10.28
I am trying to upgrade it to version 8.
There's an article here describing how to do that: https://learn.microsoft.com/en-us/azure/nodejs-specify-node-version-azure-apps
First, I added the key in the Application Settings in Azure Portal:
It didn't work, so I also changed packages.json:
{
"name": "azure_cosmos_db_webservice",
"version": "0.0.0",
"private": true,
"scripts": {
"start": "node --inspect server.js"
},
"engines":{"node": "8.x"}, <-- This line added by me
"dependencies": {
"async": "^2.1.2",
"body-parser": "~1.15.2",
"cookie-parser": "~1.4.3",
"debug": "~2.2.0",
"documentdb": "^1.10.0",
"dotenv": "^4.0.0",
"express": "~4.14.0",
"morgan": "~1.7.0",
"serve-favicon": "~2.3.0"
}
}
I've restarted the app service several times by stopping and starting it again.
However, node -v in the console in Azure Portal is still showing the version as 0.10.28.
What did I miss?
Turns out that 8.x was not a correct syntax.
I've changed it to 8.1.4 both in packages.json and in the Application Settings, and it worked.
I found the list of supported versions here:
https://MYSITE.scm.azurewebsites.net/api/diagnostics/runtime

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

After deploying to Azure Web apps, some modules are not automatically installed

After deploying to Azure Web apps, some modules are not automatically installed.
After deploying, the following error is output.
Error: Can not find module 'Cookie-parser'
At that time, I run 'npm install cookie-parser --save'.
In the package.json, the dependencies of the cookie-parser is surely saved.
{
"name": "solo",
"description": "demo",
"version": "0.0.1",
"private": true,
"license": "MIT",
"author": "lostsupervisor",
"engines": {
"node": ">=6.9.1"
},
"dependencies": {
"body-parser": "^1.17.2",
"cookie-parser": "^1.4.3",
"ejs": "^2.5.6",
"express": "^4.15.4",
"express-session": "^1.15.4",
"mssql": "^4.0.4",
"tedious": "^2.0.0"
},
"scripts": {
"start": "node index.js"
}
}
However, the same event occur after deploying next time.
Could you teach me a solution?
You are using Cookie-parser which is wrong.
In NPM modules while downloading npm upper and lower cases matter. Change it to cookie-parser, upper C is causing the problem.
It was caused by package-lock.json being not being pushed.
I solved it by pushing it.
Thank you very much.

Mongoose - deprecated mongodb#2.2.16: Please upgrade to 2.2.19 or higher?

Why do I keep getting this warning message below when I try to install mongoose?
npm WARN deprecated mongodb#2.2.16: Please upgrade to 2.2.19 or higher
json:
{
"name": "dummy-app",
"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",
"pug": "~2.0.0-beta3",
"morgan": "~1.7.0",
"serve-favicon": "~2.3.0",
"mongoose": "^4.7.6"
}
}
How can I fix that?
The npm package mongodb is a dependency of mongoose: it is automatically installed by npm when you install mongoose.
mongoose v4.7.6 depends on mongodb 2.2.16 (see its package.json file), but there is a newer bugfix release available (2.2.19) which is why you see the warning.
As mongodb is a dependency of mongoose, you will have to wait for a mongoose maintainer to update the dependency: this is not an issue you have to fix in your code.
As a matter of fact, this issue is already tracked in mongoose's Github here.

Adapter is not compatible with the current version of Sails

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

Resources