error: A hook (`userconfig`) failed to load - node.js

after npm install , getting error like, i have checked every config file and also installed lodash manually after but still not working
error: A hook (`userconfig`) failed to load!
error: Error: In Sails v1.x, `sails.config.globals._` must be either `false` or an object (typically the value of `require('lodash')`)
at Sails.exposeGlobals (D:\Node_Project\POS\trunk\node_modules\sails\lib\app\private\exposeGlobals.js:47:44)
at Sails.wrapper [as exposeGlobals] (D:\Node_Project\POS\trunk\node_modules\#sailshq\lodash\lib\index.js:3250:19)
at emitNone (events.js:91:20)
at Sails.emit (events.js:185:7)
at Sails.emitter.emit (D:\Node_Project\POS\trunk\node_modules\sails\lib\app\private\after.js:50:11)
at D:\Node_Project\POS\trunk\node_modules\sails\lib\app\private\loadHooks.js:111:15
at Hook.initialize (D:\Node_Project\POS\trunk\node_modules\sails\lib\hooks\index.js:154:14)
at Hook.wrapper [as initialize] (D:\Node_Project\POS\trunk\node_modules\#sailshq\lodash\lib\index.js:3250:19)
at D:\Node_Project\POS\trunk\node_modules\sails\lib\hooks\index.js:88:16
at D:\Node_Project\POS\trunk\node_modules\sails\node_modules\async\dist\async.js:486:20

First : Make sure you've installed dependencies with npm install
Second : Check that this app was built for a compatible version of Sails.

Related

when using create-react-app; I get Compiling RuleSet failed Error when running npm start. Query arguments on 'loader' has been removed

While setting up my dev environment for react, I've become unable to get a server to run. I've done fresh re-installs of npm, node, create-react-app, and I get thrown the same error everytime I run npm start.
/Users/sophiamatthews/Desktop/Coding?/7-react-tutorial/node_modules/react-scripts/scripts/start.js:19
throw err;
^
Error: Compiling RuleSet failed: Query arguments on 'loader' has been removed in favor of the 'options' property (at ruleSet[1].rules[0].loader: /Users/sophiamatthews/Desktop/Coding?/7-react-tutorial/node_modules/source-map-loader/dist/cjs.js)
at RuleSetCompiler.error (/Users/sophiamatthews/Desktop/Coding?/7-react-tutorial/node_modules/webpack/lib/rules/RuleSetCompiler.js:373:10)
at /Users/sophiamatthews/Desktop/Coding?/7-react-tutorial/node_modules/webpack/lib/rules/UseEffectRulePlugin.js:160:29
at Hook.eval [as call] (eval at create (/Users/sophiamatthews/Desktop/Coding?/7-react-tutorial/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:49:1)
at RuleSetCompiler.compileRule (/Users/sophiamatthews/Desktop/Coding?/7-react-tutorial/node_modules/webpack/lib/rules/RuleSetCompiler.js:177:19)
at /Users/sophiamatthews/Desktop/Coding?/7-react-tutorial/node_modules/webpack/lib/rules/RuleSetCompiler.js:154:9
at Array.map (<anonymous>)
at RuleSetCompiler.compileRules (/Users/sophiamatthews/Desktop/Coding?/7-react-tutorial/node_modules/webpack/lib/rules/RuleSetCompiler.js:153:16)
at RuleSetCompiler.compileRule (/Users/sophiamatthews/Desktop/Coding?/7-react-tutorial/node_modules/webpack/lib/rules/RuleSetCompiler.js:184:30)
at /Users/sophiamatthews/Desktop/Coding?/7-react-tutorial/node_modules/webpack/lib/rules/RuleSetCompiler.js:154:9
at Array.map (<anonymous>)
This is being done on a new machine that hasn't had any developer tools installed previously.
Not a Duplicate of Error: Compiling RuleSet failed: Query arguments on 'loader' has been removed in favor of the 'options' property
My error occurs in a different file that has a different structure.
7-react-tutorial/node_modules/source-map-loader/dist/cjs.js looks as such
"use strict";
const loader = require("./index");
module.exports = loader.default;
module.exports.raw = loader.raw;

NGCC failed error in Angular 11.x app when running npm run

I have an Angular 11.x app that I run using npm run start - this has worked fine for months but all of a sudden it is no longer running the command and I am getting the following errors, can anyone suggest how I fix this? I have tried the obvious ideas of deleting node_modules and reinstalling them using npm install but with no joy.
Below is the error I get after running npm run start - what have I done to break this :(
Compiling #angular/core : es2015 as esm2015
Error: Error on worker #1: TypeError: Cannot read property 'map' of undefined
at injectDependencies (/Users/zabius/Sites/abc-ui-ng4/node_modules/#angular/compiler/bundles/compiler.umd.js:6960:21)
at compileFactoryFunction (/Users/zabius/Sites/abc-ui-ng4/node_modules/#angular/compiler/bundles/compiler.umd.js:6888:61)
at Object.compileInjector (/Users/zabius/Sites/abc-ui-ng4/node_modules/#angular/compiler/bundles/compiler.umd.js:8106:22)
at NgModuleDecoratorHandler.compileFull (/Users/zabius/Sites/abc-ui-ng4/node_modules/#angular/compiler-cli/src/ngtsc/annotations/src/ng_module.js:427:44)
at _loop_2 (/Users/zabius/Sites/abc-ui-ng4/node_modules/#angular/compiler-cli/src/ngtsc/transform/src/compilation.js:595:39)
at NgccTraitCompiler.TraitCompiler.compile (/Users/zabius/Sites/abc-ui-ng4/node_modules/#angular/compiler-cli/src/ngtsc/transform/src/compilation.js:626:21)
at DecorationAnalyzer.compileFile (/Users/zabius/Sites/abc-ui-ng4/node_modules/#angular/compiler-cli/ngcc/src/analysis/decoration_analyzer.js:225:53)
at DecorationAnalyzer.analyzeProgram (/Users/zabius/Sites/abc-ui-ng4/node_modules/#angular/compiler-cli/ngcc/src/analysis/decoration_analyzer.js:164:45)
at Transformer.analyzeProgram (/Users/zabius/Sites/abc-ui-ng4/node_modules/#angular/compiler-cli/ngcc/src/packages/transformer.js:135:57)
at Transformer.transform (/Users/zabius/Sites/abc-ui-ng4/node_modules/#angular/compiler-cli/ngcc/src/packages/transformer.js:77:27)
at ClusterMaster.onWorkerMessage (/Users/zabius/Sites/abc-ui-ng4/node_modules/#angular/compiler-cli/ngcc/src/execution/cluster/master.js:195:27)
at /Users/zabius/Sites/abc-ui-ng4/node_modules/#angular/compiler-cli/ngcc/src/execution/cluster/master.js:55:95
at ClusterMaster.<anonymous> (/Users/zabius/Sites/abc-ui-ng4/node_modules/#angular/compiler-cli/ngcc/src/execution/cluster/master.js:293:57)
at step (/Users/zabius/Sites/abc-ui-ng4/node_modules/tslib/tslib.js:143:27)
at Object.next (/Users/zabius/Sites/abc-ui-ng4/node_modules/tslib/tslib.js:124:57)
at /Users/zabius/Sites/abc-ui-ng4/node_modules/tslib/tslib.js:117:75
at new Promise (<anonymous>)
at Object.__awaiter (/Users/zabius/Sites/abc-ui-ng4/node_modules/tslib/tslib.js:113:16)
at EventEmitter.<anonymous> (/Users/zabius/Sites/abc-ui-ng4/node_modules/#angular/compiler-cli/ngcc/src/execution/cluster/master.js:287:32)
at EventEmitter.emit (events.js:315:20)
An unhandled exception occurred: NGCC failed.
See "/private/var/folders/b2/1zfdxz293d944p_lxk9_ypz40000gn/T/ng-XQcM3b/angular-errors.log" for further details.
The error in the angular-errors.log file is as follows -
[error] Error: NGCC failed.
at NgccProcessor.process (/Users/zabius/Sites/abc-ui-ng4/node_modules/#ngtools/webpack/src/ngcc_processor.js:129:19)
at /Users/zabius/Sites/abc-ui-ng4/node_modules/#ngtools/webpack/src/angular_compiler_plugin.js:593:31
at SyncHook.eval [as call] (eval at create (/Users/zabius/Sites/abc-ui-ng4/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:19:10$
at SyncHook.lazyCompileHook (/Users/zabius/Sites/abc-ui-ng4/node_modules/webpack/node_modules/tapable/lib/Hook.js:154:20)
at Object.webpack [as webpackFactory] (/Users/zabius/Sites/abc-ui-ng4/node_modules/webpack/lib/webpack.js:55:30)
at createWebpack (/Users/zabius/Sites/abc-ui-ng4/node_modules/#angular-devkit/build-webpack/src/webpack-dev-server/index.js:21:36)
at Object.runWebpackDevServer (/Users/zabius/Sites/abc-ui-ng4/node_modules/#angular-devkit/build-webpack/src/webpack-dev-server/index.js:47:12)
at SwitchMapSubscriber.project (/Users/zabius/Sites/abc-ui-ng4/node_modules/#angular-devkit/build-angular/src/dev-server/index.js:209:32)
at SwitchMapSubscriber._next (/Users/zabius/Sites/abc-ui-ng4/node_modules/#angular-devkit/build-angular/node_modules/rxjs/internal/operators/swit$
at SwitchMapSubscriber.Subscriber.next (/Users/zabius/Sites/abc-ui-ng4/node_modules/#angular-devkit/build-angular/node_modules/rxjs/internal/Subs$
at /Users/zabius/Sites/abc-ui-ng4/node_modules/#angular-devkit/build-angular/node_modules/rxjs/internal/util/subscribeToPromise.js:7:24
at processTicksAndRejections (internal/process/task_queues.js:93:5)
Versions :
npm -v 8.1.0
node -v 14.15.4
Using MacOS BigSur 11.5.2

unable to start nodejs app- Error: npm.load() required

whenever I am starting my Node app it's giving following error.
Error: Failed to replace env in config: ${NPM_TOKEN}
at /usr/local/lib/node_modules/npm/lib/config/core.js:429:13
at String.replace (native)
at envReplace (/usr/local/lib/node_modules/npm/lib/config/core.js:424:12)
at parseField (/usr/local/lib/node_modules/npm/lib/config/core.js:400:7)
at /usr/local/lib/node_modules/npm/lib/config/core.js:338:17
at Array.forEach (native)
at Conf.add (/usr/local/lib/node_modules/npm/lib/config/core.js:337:23)
at ConfigChain.addString (/usr/local/lib/node_modules/npm/node_modules/config-chain/index.js:244:8)
at Conf.<anonymous> (/usr/local/lib/node_modules/npm/lib/config/core.js:325:10)
at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:78:16
/usr/local/lib/node_modules/npm/lib/npm.js:29
throw new Error('npm.load() required')
^
Error: npm.load() required
at Object.npm.config.get (/usr/local/lib/node_modules/npm/lib/npm.js:29:11)
at exit (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:58:40)
at process.errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:387:3)
at emitOne (events.js:77:13)
at process.emit (events.js:169:7)
at process._fatalException (node.js:224:26)
Plz provide any solution. I totally stucked with this.Due to this issue I am unable to start my app and complete my work.
Temporary remove file .npmrc with your ${NPM_TOKEN}
Switch to proper node version ( with node version manager you can run like nvm use 12 )
export your environment variable "export NPM_TOKEN=yourvalue"
move back your .npmrc file and try to run your project again!

Fresh meteor 1.3 on win7 not runnning

I am also posting this on stackoverflow as this is suggested by meteor itself :)
I upgraded my meteor project to Meteor 1.3, and after updating all the proper packages I could not get meteor 1.3 to run. Then I created a fresh project and still get this error I posted below. I also tried to create the simple-todos example shown here https://www.meteor.com/tutorials/blaze/creating-an-app in CMD. Same result.
Windows 7 btw :) Also I have not installed meteorhacks:npm or any other extra packages whatsoever.
http.js:733
throw new TypeError('The header content contains invalid characters');
^
TypeError: The header content contains invalid characters
at ClientRequest.OutgoingMessage.setHeader (http.js:733:13)
at new ClientRequest (http.js:1429:14)
at Object.exports.request (http.js:1899:10)
at Array.stream [as 3] (C:\Users\Lightspeed\AppData\Local\.meteor\packages\meteor-tool\1.3.0_3\mt-os.windows.x86_32\dev_bundle\lib\node_modules\http-proxy\lib\http-proxy\passes\web-incoming.js:108:74)
at ProxyServer.<anonymous> (C:\Users\Lightspeed\AppData\Local\.meteor\packages\meteor-tool\1.3.0_3\mt-os.windows.x86_32\dev_bundle\lib\node_modules\http-proxy\lib\http-proxy\index.js:80:21)
at Proxy._tryHandleConnections (C:\tools\runners\run-proxy.js:182:20)
at Server.<anonymous> (C:\tools\runners\run-proxy.js:50:12)
at Server.emit (events.js:98:17)
at HTTPParser.parser.onIncoming (http.js:2164:12)
at HTTPParser.parserOnHeadersComplete [as onHeadersComplete] (http.js:152:23)
at Socket.socket.ondata (http.js:2022:22)
at TCP.onread (net.js:528:27)
Meteor does startup properly and does not crash until I actually navigate to localhost:3000. The page immediately errors (host not reachable) and meteor crashes with the error shown in my OP.
This problem was related to a specific windows 7 version. Though I don't have specifics anymore, it has been resolved.

Node.js redis "unknown command 'hset'"?

I'm new to redis, and I'm trying out various examples. However, it doesn't seem to work:
root#localhost:~# node lol.js
Reply: OK
Error: Error: Error: ERR unknown command 'hset'
Error: Error: Error: ERR unknown command 'hset'
/root/node_modules/redis/index.js:468
throw callback_err;
^
TypeError: Cannot read property 'length' of undefined
at Command.callback (/root/lol.js:15:28)
at RedisClient.return_error (/root/node_modules/redis/index.js:464:25)
at HiredisReplyParser.<anonymous> (/root/node_modules/redis/index.js:253:14)
at HiredisReplyParser.emit (events.js:67:17)
at HiredisReplyParser.execute (/root/node_modules/redis/lib/parser/hiredis.js:41:18)
at RedisClient.on_data (/root/node_modules/redis/index.js:440:27)
at Socket.<anonymous> (/root/node_modules/redis/index.js:70:14)
at Socket.emit (events.js:67:17)
at TCP.onread (net.js:367:14)
I'm using one of the example scripts on the github page for node-redis. I'm on Debian Squeeze.
The main problem is not with your code (of course it could recognize the error sent by the server) or with the node redis module but with the Redis server.
You need to upgrade it to a newer version, HSET command is supported since version 2.0.0.

Resources