this error happens to me when I want to do the npm install and it is canceled in the middle of the process, It should be noted that this did not happen before.
I already applied many of the suggestions I saw, for example: disable the anti virus, run as administrator, among others.
version node :10.13.0 and 10.16.0 (nvm)
version angular :8.0.0
error console PowerShell
my dependencies project
"dependencies": {
"#agm/core": "^1.0.0-beta.5",
"#angular-material-components/datetime-picker": "^2.0.3",
"#angular-material-components/moment-adapter": "^2.0.1",
"#angular/animations": "^8.0.0",
"#angular/cdk": "^8.0.0",
"#angular/common": "^8.0.0",
"#angular/compiler": "^8.0.0",
"#angular/core": "^8.0.0",
"#angular/fire": "^5.2.3",
"#angular/flex-layout": "^7.0.0-beta.23",
"#angular/forms": "^8.0.0",
"#angular/http": "^7.2.1",
"#angular/material": "^8.0.0",
"#angular/material-moment-adapter": "^8.0.2",
"#angular/platform-browser": "^8.0.0",
"#angular/platform-browser-dynamic": "^8.0.0",
"#angular/platform-server": "^8.0.0",
"#angular/router": "^8.0.0",
"#auth0/angular-jwt": "^2.1.0",
"#ng-bootstrap/ng-bootstrap": "^4.0.1",
"#ngx-translate/core": "^11.0.1",
"#ngx-translate/http-loader": "^4.0.0",
"#swimlane/ngx-datatable": "^15.0.0",
"#tinymce/tinymce-angular": "^3.5.0",
"#types/lodash": "^4.14.106",
"#types/pdfjs-dist": "~2.0.1",
"amazing-time-picker": "^1.8.0",
"angular-calendar": "^0.27.19",
"angularfire2": "^5.1.1",
"animate.css": "^3.7.0",
"card": "^2.4.0",
"chart.js": "^2.8.0",
"classlist.js": "^1.1.20150312",
"core-js": "^2.6.2",
"css-element-queries": "^1.1.1",
"date-fns": "^1.30.1",
"easy-pie-chart": "^2.1.7",
"file-saver": "^2.0.2",
"firebase": "^5.8.0",
"font-awesome": "4.7.0",
"hammerjs": "^2.0.8",
"intl": "^1.2.5",
"jquery": "^3.3.1",
"moment": "^2.23.0",
"ng-block-ui": "^2.1.0",
"ng-circle-progress": "^1.5.1",
"ng-currency-format": "^0.1.6",
"ng2-charts": "^1.6.0",
"ng2-currency-mask": "^5.3.1",
"ng2-pdf-viewer": "~5.3.4",
"ng2-validation": "^4.2.0",
"ng2modules-easypiechart": "0.0.4",
"ng5-breadcrumb": "0.0.6",
"ngx-device-detector": "1.4.2",
"ngx-mat-select-search": "^1.7.6",
"ngx-perfect-scrollbar": "^7.2.0",
"ngx-slick-carousel": "^0.4.4",
"ngx-spinner": "^7.1.0",
"ngx-toastr": "^9.1.1",
"ngx-tour-core": "4.1.1",
"ngx-tour-md-menu": "4.1.1",
"ngx-tour-ng-bootstrap": "^4.0.1",
"ngx-webcam": "^0.2.5",
"node-sass": "^4.14.1",
"normalize.css": "^8.0.1",
"pdfjs-dist": "2.5.207",
"perfect-scrollbar": "^1.4.0",
"promise-polyfill": "^8.1.0",
"rxjs": "^6.3.3",
"rxjs-compat": "^6.3.3",
"screenfull": "^4.0.0",
"slick-carousel": "^1.8.1",
"sortablejs": "^1.8.1",
"sweetalert2": "^8.19.0",
"ts-helpers": "^1.1.2",
"videogular2": "^6.4.0",
"web-animations-js": "^2.3.1",
"zone.js": "~0.10.2"
},
"devDependencies": {
"#angular-devkit/build-angular": "^0.800.0",
"#angular/cli": "^8.0.0",
"#angular/compiler-cli": "^8.0.0",
"#angular/language-service": "^8.0.0",
"#types/jasmine": "^3.3.7",
"#types/jquery": "^3.3.29",
"#types/node": "^10.12.18",
"#types/systemjs": "^0.20.6",
"#types/webpack-env": "^1.13.7",
"codelyzer": "^4.5.0",
"gulp-sass": "^5.0.0",
"jasmine-core": "^3.3.0",
"jasmine-spec-reporter": "^4.2.1",
"karma": "^4.0.0",
"karma-chrome-launcher": "^2.2.0",
"karma-cli": "^2.0.0",
"karma-coverage-istanbul-reporter": "^2.0.4",
"karma-jasmine": "^2.0.1",
"karma-jasmine-html-reporter": "^1.4.0",
"karma-phantomjs-launcher": "^1.0.4",
"node-sass-magic-importer": "^5.3.2",
"protractor": "^5.4.2",
"rxjs-tslint": "^0.1.6",
"ts-node": "^7.0.1",
"tslint": "^5.12.1",
"typescript": "3.4.5",
"webpack-bundle-analyzer": "^4.5.0"
}
Application Usage
The error might be coming up as it is already in use by another program (without you realising about it, meaning it is running in the background).
To fix this issue, you need to find out which process(es) is/are using the folder. There are multiple methods to do this, and there is a discussion about this here.
You can use the Resource Monitor on Windows 7, 8, 10 and 11, or you can also use PowerShell. There is also an application made by Microsoft in the Sysinternals suite called Process Explorer.
Once you've found the process which is using the folder, you can kill the task. Warning! Do not kill the program if you are unsure of what it is, as it could be a core system file, and ending it may result in irregular behaviour, crashes, and more.
Once you've done that, and the process has been successfully ended, you can run the following command again.
npm install
Hopefully, then, the command should run successfully when the install script changes the folder!
Permission Lack
To fix a permission lack, you need to run the script as an administrator. To do this, run the script in an Administrator Command Prompt or Administrator PowerShell window.
Then, inside of it, run the following command.
npm install
If that doesn't work, you may have to change the permissions of the folder. You can see the instructions here.
Issue:
There is a open issue with latest npm on windows, please check here
Workaround
In the above case eventhough there is no direct dependency of npm, npm getting installed in node modules. So please check package lock file if there is npm in it and the package referring it. If you can correct the package referring npm or downgrading or removing will work.
Install npm#8.3.1 as dev dependency
I would suggest to go with Workaround 1 rather than Workaround 2 as we don't need npm dependency in package as it already been installed globally.
I am trying to the run an electron app on windows that uses aws-crt. Everything works fine on MacOS.
But in windows, I get this error:
App threw an error during load
Error: A dynamic link library (DLL) initialization routine failed.
\\?\C:\Code\mir-kiosk-electron\electron-kiosk\node_modules\aws-crt\dist\bin\win32-x64\aws-crt-nodejs.node
at process.func [as dlopen] (electron/js2c/asar_bundle.js:5:1846)
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1138:18)
at Object.func [as .node] (electron/js2c/asar_bundle.js:5:1846)
at Module.load (internal/modules/cjs/loader.js:935:32)
at Module._load (internal/modules/cjs/loader.js:776:14)
at Function.f._load (electron/js2c/asar_bundle.js:5:12684)
at Module.require (internal/modules/cjs/loader.js:959:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (C:\Code\mir-kiosk-electron\electron-kiosk\.webpack\main\index.js:8461:19)
at Object../node_modules/aws-crt/dist/native/binding.js (C:\Code\mir-kiosk-electron\electron-kiosk\.webpack\main\index.js:8470:30)
webpack built f8189be91ec9475472dc in 1864ms
What should I do?
I found a similar issue in https://github.com/electron/electron/issues/11853.
It says I need to rebuild the node module.
I have already done
.\node_modules\.bin\electron-rebuild.cmd
The error is still there.
Here is my package.json
"dependencies": {
"aws-crt": "^1.7.1",
"aws-iot-device-sdk-v2": "^1.5.1",
"axios": "^0.21.1",
"electron-squirrel-startup": "^1.0.0",
"jimp": "^0.16.1",
"pixelmatch": "^5.2.1",
"pngjs": "^6.0.0",
"react": "^17.0.2",
"react-dom": "^17.0.2"
}
My gut feeling is I need to rebuild aws-crt for electron. But how do I do it?
I have a node application that runs fine when executed on my machine via node my_application.js.
However, if push it to heroku and execute it via heroku run node my_application.js or with the scheduler what I get is this error:
internal/modules/cjs/loader.js:638
throw err;
^
Error: Cannot find module './mergeConfig'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (/app/node_modules/axios/lib/core/Axios.js:7:19)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
I'm running node v10.16.0 and npm v6.9.0 both locally and on Heroku, so I really don't know what may be causing this issue, and googling for it didn't help in any way.
Any ideas about this mergeConfig module that seems to be missing from my heroku environment but not from my local environment?
Edit: this is my package.json:
{
"name": "[REDACTED]",
"version": "1.0.0",
"description": "[REDACTED]",
"author": "",
"license": "ISC",
"dependencies": {
"axios": "^0.19.0",
"bluebird": "^3.5.3",
"body-parser": "^1.18.3",
"dateformat": "^3.0.3",
"express": "^4.16.4",
"form-data": "^2.3.3",
"http-to-curl": "^1.4.2",
"jest": "^24.8.0",
"qs": "^6.6.0",
"querystring": "^0.2.0",
"redis": "^2.8.0",
"simple-oauth2": "^2.2.1"
}
}
Try to add explicitly the missing module in the dependencies in package.json:
"dependencies": {
...
"merge-config" :"2.0.0"
...
}
I think it works on your local environment because you have the module installed globally.
I had the same problem.
'./mergeConfig' is a file inside de axios module.
Path: node_modules/axios/core/mergeConfig.js
For some reason heroku had a problem with this file.
I solved it by replacing axios with request.
This fixed the problem for me NODE_OPTIONS=--max_old_space_size=4096
src: https://github.com/axios/axios/issues/1767#issuecomment-416924946
I'm trying to deploy my node.js app to heroku.
I'm getting this error on git push heroku master:
> on-headers#1.0.1 test /tmp/build_4d6fe429e576b4e42425b713c87264e9/node_modules/response-time/node_modules/on-headers
> mocha --reporter spec --bail --check-leaks test/
/tmp/build_4d6fe429e576b4e42425b713c87264e9/node_modules/mocha/lib/utils.js:626
throw new Error("cannot resolve path (or pattern) '" + path + "'");
^
Error: cannot resolve path (or pattern) 'test/'
at Object.lookupFiles (/tmp/build_4d6fe429e576b4e42425b713c87264e9/node_modules/mocha/lib/utils.js:626:15)
at /tmp/build_4d6fe429e576b4e42425b713c87264e9/node_modules/mocha/bin/_mocha:316:30
at Array.forEach (native)
at Object.<anonymous> (/tmp/build_4d6fe429e576b4e42425b713c87264e9/node_modules/mocha/bin/_mocha:315:6)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Function.Module.runMain (module.js:467:10)
at startup (node.js:136:18)
at node.js:963:3
> node-statsd#0.1.1 test /tmp/build_4d6fe429e576b4e42425b713c87264e9/node_modules/soluto-monitor/node_modules/node-statsd
> mocha -R spec
/tmp/build_4d6fe429e576b4e42425b713c87264e9/node_modules/mocha/lib/utils.js:626
throw new Error("cannot resolve path (or pattern) '" + path + "'");
^
Error: cannot resolve path (or pattern) 'test'
at Object.lookupFiles (/tmp/build_4d6fe429e576b4e42425b713c87264e9/node_modules/mocha/lib/utils.js:626:15)
at /tmp/build_4d6fe429e576b4e42425b713c87264e9/node_modules/mocha/bin/_mocha:316:30
at Array.forEach (native)
at Object.<anonymous> (/tmp/build_4d6fe429e576b4e42425b713c87264e9/node_modules/mocha/bin/_mocha:315:6)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Function.Module.runMain (module.js:467:10)
at startup (node.js:136:18)
at node.js:963:3
...
..and on and on with the error Error: cannot resolve path (or pattern) 'test/' for each node_modules subdirectory.
my package.json looks like more or less like this:
{
"name": "my-module",
"version": "0.1.0",
"description": "My Module",
"dependencies": {
"azure-storage": "0.6.0",
"bluebird": "3.0.6",
"body-parser": "1.14.1",
"cors": "2.7.1",
"dotenv": "^1.2.0",
"express": "3.3.3",
"moment": "2.10.6",
"request-promise": "1.0.2",
"rx": "4.0.7",
"shisell": "0.0.2",
"striptags": "2.0.4",
"winston": "2.1.1"
},
"devDependencies": {
"chai": "^3.4.1",
"chai-as-promised": "^5.1.0",
"mocha": "^2.3.4",
"mock-require": "^1.2.1",
"sinon": "^1.17.2",
"sinon-chai": "^2.8.0",
"supertest": "^1.1.0"
},
"main": "server.js",
"engines": {
"node": "4.2.3"
},
"scripts": {
"test": "mocha"
}
}
it seems like mocha is trying to run from within node_modules, inside each dependency. i managed to reproduce the error locally by running mocha from within one of the node_modules directories.
I tried removing test script from my package.json and I still get the same error.
I'm new to heroku deployments. As far as I understood once I git push to heroku then heroku runs npm install and if there is a test script it will run. But I don't understand what causes it to try and run mocha within subdirectories of node_modules (and why that would happen even if I don't specify a test script inside my package.json).
Any ideas?
p.s. this doesn't happen when I run locally on my machine.
Turns out I had this environment variable set: NPM_CONFIG_NPAT=true on heroku and it causes npm to run tests on all the installations, as described here:
https://docs.npmjs.com/misc/config#npat
I'm trying to deploy a nodejs application on ubuntu 13.10. I have tested it on my local mac( working good).
But when I try to run it on my ubuntu server, i got this:
[ORMError NO_SUPPORT: Connection protocol not supported - have you installed the database driver for postgres?]
at Object.exports.connect (/home/ubuntu/node_modules/orm/lib/ORM.js:138:21)
at Object.module.exports (/home/ubuntu/node_modules/orm/lib/Express.js:12:6)
at Object.exports.express (/home/ubuntu/node_modules/orm/lib/ORM.js:39:30)
at Object.<anonymous> (/home/ubuntu/www/sher/nodejs/app.js:30:13)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
error: Forever detected script exited with code: 8
FYI:
I installed npm install pg after i got this error, but didn't work.
I also instadded postgresql9.1 with sudo apt-get install build-essential postgresql-9.1 postgresql-server-dev-9.1 libxml2-dev libproj-dev libjson0-dev xsltproc docbook-xsl docbook-mathml.
Anyone can suggest any idea whats going on here?
Thank you!
{
"name": "nodejs",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node ./bin/www"
},
"dependencies": {
"express": "~4.2.0",
"static-favicon": "~1.0.0",
"morgan": "~1.0.0",
"cookie-parser": "~1.0.1",
"body-parser": "~1.0.0",
"debug": "~0.7.4",
"jade": "~1.3.0"
}
}
I just reinstalled all packages and modules again one by one. Seems fixed the problem.