every command begin with npm has issue - npm

Here is my problem,
I think I made mistake by adding proxy settings in a wrong way,
now every command begin with npm does not work.
here is a pic of the error:
λ npm config set registry "http://registry.npmjs.org/"
Error: Failed parsing JSON config key "proxy: "="'http://xxx.xx.xx.xx:8080'"
at parseField (E:\nodejs\node_modules\npm\lib\config\core.js:376:13)
at E:\nodejs\node_modules\npm\lib\config\core.js:330:24
at Array.forEach (<anonymous>)
at Conf.add (E:\nodejs\node_modules\npm\lib\config\core.js:328:23)
at ConfigChain.addString (E:\nodejs\node_modules\npm\node_modules\config-chain\index.js:244:8)
at Conf.<anonymous> (E:\nodejs\node_modules\npm\lib\config\core.js:316:10)
at E:\nodejs\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:123:16
at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:63:3)
Error: Failed parsing JSON config key "proxy: "="'http://xxx.xx.xx.xx:8080'"
at parseField (E:\nodejs\node_modules\npm\lib\config\core.js:376:13)
at E:\nodejs\node_modules\npm\lib\config\core.js:330:24
at Array.forEach (<anonymous>)
at Conf.add (E:\nodejs\node_modules\npm\lib\config\core.js:328:23)
at ConfigChain.addString (E:\nodejs\node_modules\npm\node_modules\config-chain\index.js:244:8)
at Conf.<anonymous> (E:\nodejs\node_modules\npm\lib\config\core.js:316:10)
at E:\nodejs\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:123:16
at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:63:3)

Assuming you set your proxy setting in a similar way to the registry setting you show: Delete the proxy line in your .npmrc file and try again. The .npmrc file can be found in the four places listed in the npm docs. In most cases, you'll find the one with the proxy entry in ~/.npmrc.

Related

Azure Data Factory Automated publishing for continuous integration and delivery

I’m following the new CICD guide for ADF https://learn.microsoft.com/en-us/azure/data-factory/continuous-integration-deployment-improvements
Looks like I'm missing files credential and managedVirtualNetwork. Do I need to set up authentication with the npm module and Azure packages?
Getting these errors:
LocalFileClientService: Unable to list files for: credential, error: Error: ENOENT: no such file or directory, scandir '/home/vsts/work/1/s/credential'
…
LocalFileClientService: Unable to list files for: managedVirtualNetwork, error: Error: ENOENT: no such file or directory, scandir '/home/vsts/work/1/s/managedVirtualNetwork'
…
ERROR === CmdApiApp: Failed to run resource validation. Error: {"stack":"TypeError: Cannot read property 'concept' of undefined\n at Function.<anonymous> (/home/vsts/work/1/s/downloads/main.js:1271:27040)\n at /home/vsts/work/1/s/downloads/main.js:16:2243\n at Object.next (/home/vsts/work/1/s/downloads/main.js:16:2348)\n at o (/home/vsts/work/1/s/downloads/main.js:16:1087)","message":"Cannot read property 'concept' of undefined"}
…
error code ELIFECYCLE
error errno 1
error # build: `node node_modules/#microsoft/azure-data-factory-utilities/lib/index "validate" "/home/vsts/work/1/s" "subscriptions/xxxxxxx/resourceGroups/xxxxxxx/providers/Microsoft.DataFactory/factories/xxxxxxxx”
error Exit status 1
error Failed at the # build script.
error This is probably not a problem with npm. There is likely additional logging output above.
##[error]Error: Npm failed with return code: 1
The missing credential and managedVirtualNetwork folders are not an issue. I am able to validate and export the ARM template even without having those folders.
I was able to reproduce the error with an incorrect ADF Resource ID. The leading / before 'subscriptions' is missing. Changing the Resource ID to /subscriptions/xxxxxxx/resourceGroups/xxxxxxx/providers/Microsoft.DataFactory/factories/xxxxxxxx should work.

React-native/hermes build error. no such file or directory: index.android.bundle.packager.map

Description
Getting the following messages during build with hermesEnabled set to true
('...' represent removed text):
(full error log is here)
android\app\build\generated\assets\react\release\index.android.bundle:13:134: warning: the variable "Promise" was not declared in function "isBoldTextEnabled"
...
android\app\build\generated\assets\react\release\index.android.bundle:27:2907: warning: the variable "DebuggerInternal" was not declared in function "value 14#"
...
android\app\build\generated\assets\react\release\index.android.bundle:92:57773: warning: the variable "setTimeout" was not declared in function "wi"
...
fs.js:114
throw err;
^
Error: ENOENT: no such file or directory, open 'android\app\build\intermediates\sourcemaps\react\release\index.android.bundle.packager.map'
at Object.openSync (fs.js:443:3)
at Object.readFileSync (fs.js:343:35)
at Object.<anonymous> (C:\esites-grocery\test2.hermes\plumpclient\node_modules\react-native\scripts\compose-source-maps.js:33:43)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789: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)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
FAILURE: Build failed with an exception.
* Where:
Script 'node_modules\react-native\react.gradle' line: 191
* What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssets'.
> Process 'command 'cmd'' finished with non-zero exit value 1
(The referenced file exists, at least after the build failed).
Environment
Building on Windows 10
React Native version: 0.62.2
What I tried to do
Tried to bump soLoader to 0.8.0 and to 0.8.2 (although this is not supposed to be needed in RN 0.62.2) as suggested in https://github.com/facebook/react-native/issues/25927#issuecomment-539415154
Modifying the following extra packages definition in build.gradle:
extraPackagerArgs: ["--sourcemap-output", "$buildDir/intermediates/assets/release/index.android.bundle.map"]
to
extraPackagerArgs: ["--sourcemap-output", "$buildDir/intermediates/sourcemaps/react/release/index.android.bundle.packager.map"]
Fixed the error (the warnings are still there).
An APK is created and is running..
./gradlew clean
After doing the ./gradlew clean It worked for me.
OR
For Windows:
gralde clean

Node.js/ webpack/ getaddrinfo looking for internet when not needed, why?

I've got an issue with a machine that's supposed to be able to run offline.
I can pull the cable after my application is running, but during unplugged start I get the following error:
May 6 23:04:50 myco serve[4121]: (node:4121) UnhandledPromiseRejectionWarning: Error: getaddrinfo EAI_AGAIN registry.npmjs.org:443
May 6 23:04:50 myco serve[4121]: at Object._errnoException (util.js:1022:11)
May 6 23:04:50 myco serve[4121]: at errnoException (dns.js:55:15)
May 6 23:04:50 myco serve[4121]: at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26)
May 6 23:04:50 myco serve[4121]: (node:4121) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
May 6 23:04:50 myco serve[4121]: (node:4121) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
It appears that dns.js is part of webpack/node-libs-browser but thats as far as I can seem to figure out.... I can't find GetAddrInfoReqWrap anywhere in my source tree, or getaddrinfo for that matter. Searching around there's a lot of info with people getting similar errors when deliberately trying to use npm, but thats not what I'm doing. I should have everything I need already on the machine.
Apparently this is a problem with serve.
Serve >6.5.3 apparently has an issue where it tries to contact the registry. Downgrade of serve to 6.5.3 solves this particular issue.
this is documented in https://github.com/zeit/serve/issues/348
not sure why serve would need to contact the registry.
noafterglow is right, but just for reference, rolling back to version 6.5.3 of serve can be accomplished with
npm install -g serve#6.5.3
Source: this post
I ran into exactly this error when trying to serve a VueJs app from a different VM from where the code was developed originally.
The file vue.config.js read :
module.exports = {
devServer: {
host: 'tstvm01',
port: 3030,
},
};
When served on the original machine the start up output is :
App running at:
- Local: http://tstvm01:3030/
- Network: http://tstvm01:3030/
Using the same settings on a VM tstvm07 got me a very similar error to the one the OP describes:
INFO Starting development server...
10% building modules 1/1 modules 0 activeevents.js:183
throw er; // Unhandled 'error' event
^
Error: getaddrinfo EAI_AGAIN
at Object._errnoException (util.js:1022:11)
at errnoException (dns.js:55:15)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26)
If it ain't already obvious, changing vue.config.js to read ...
module.exports = {
devServer: {
host: 'tstvm07',
port: 3030,
},
};
... solved the problem.

JSMP init command getting einval error

jspm init results in:
Package.json file does not exist, create it? [yes]:
err Error: EINVAL, invalid argument
at new Socket (net.js:157:18)
at process.stdin (node.js:687:19)
at MY_FOLDER\aurelia\aurelia-typescript-simple\node_modules\jspm\lib\ui.js:202:12
at lib$rsvp$$internal$$initializePromise (MY_FOLDER\aurelia\aurelia-typescript-simple\node_modules\jspm\node_modules\rsvp\dist\rsvp.js:1084:9)
at new lib$rsvp$promise$$Promise (MY_FOLDER\aurelia\aurelia-typescript-simple\node_modules\jspm\node_modules\rsvp\dist\rsvp.js:546:53)
at Object.exports.input (MY_FOLDER\aurelia\aurelia-typescript-simple\node_modules\jspm\lib\ui.js:190:10)
at Object.exports.confirm (MY_FOLDER\aurelia\aurelia-typescript-simple\node_modules\jspm\lib\ui.js:157:15)
at Promise.resolve.then.then.config.pjsonPath (MY_FOLDER\aurelia\aurelia-typescript-simple\node_modules\jspm\lib\config.js:70:17)
at tryCatchReject (MY_FOLDER\aurelia\aurelia-typescript-simple\node_modules\jspm\node_modules\systemjs\node_modules\when\es6-shim\Promise.js:1183:30)
at runContinuation1 (MY_FOLDER\aurelia\aurelia-typescript-simple\node_modules\jspm\node_modules\systemjs\node_modules\when\es6-shim\Promise.js:1142:4)
at Fulfilled.when (MY_FOLDER\aurelia\aurelia-typescript-simple\node_modules\jspm\node_modules\systemjs\node_modules\when\es6-shim\Promise.js:930:4)
at ContinuationTask.run (MY_FOLDER\aurelia\aurelia-typescript-simple\node_modules\jspm\node_modules\systemjs\node_modules\when\es6-shim\Promise.js:1040:24)
at Scheduler._drain (MY_FOLDER\aurelia\aurelia-typescript-simple\node_modules\jspm\node_modules\systemjs\node_modules\when\es6-shim\Promise.js:97:19)
at Scheduler.drain (MY_FOLDER\aurelia\aurelia-typescript-simple\node_modules\jspm\node_modules\systemjs\node_modules\when\es6-shim\Promise.js:62:9)
at process._tickCallback (node.js:442:13)
at Function.Module.runMain (module.js:499:11)
Could be related to this: https://github.com/jspm/jspm-cli/issues/610
Looks like this issue could be related to my cygwin installation: Node.js Cygwin not supported
Maybe it cannot enter the interactive prompt.
Using jspm init -y worked but it is not mentioned in most tutorials.

Mongoose error when running node

When I run node server.js in terminal, I receive the following error from mongoose:
/Users/XXXX/Desktop/Projects/crud/node_modules/mongoose/node_modules/mongodb/lib/server.js:235
process.nextTick(function() { throw err; })
^
Error: connect ECONNREFUSED 127.0.0.1:27017
at Object.exports._errnoException (util.js:860:11)
at exports._exceptionWithHostPort (util.js:883:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1063:14)
I've ran npm install mongoose with a warning, but I doubt that's the reason the mongodb database isn't running. Here is the warning:
> kerberos#0.0.17 install /Users/Sean/Desktop/Projects/crud/node_modules/kerberos
> (node-gyp rebuild) || (exit 0)
CXX(target) Release/obj.target/kerberos/lib/kerberos.o
CXX(target) Release/obj.target/kerberos/lib/worker.o
CC(target) Release/obj.target/kerberos/lib/kerberosgss.o
../lib/kerberosgss.c:509:13: warning: implicit declaration of function 'gss_acquire_cred_impersonate_name' is invalid in C99
[-Wimplicit-function-declaration]
maj_stat = gss_acquire_cred_impersonate_name(&min_stat,
^
1 warning generated.
CC(target) Release/obj.target/kerberos/lib/base64.o
CXX(target) Release/obj.target/kerberos/lib/kerberos_context.o
SOLINK_MODULE(target) Release/kerberos.node
It can happen when the mongodb service is not running on your machine.So start with below command it will be help you to open node server with no interrupt as well as mongodb will also run on default port.
brew services start mongodb