Cannot read property 'run' of undefined (awesome-typescript-loader) - npm

I'm attempting to update our angular 5 application to angular 6, and am running into a build issue currently with awesome-typescript loader.
The full error message is
C:\source\ProjectFolder\Angular.Web.App\node_modules\awesome-typescript-loader\src\watch-mode.ts:5
compiler.hooks.run.tapAsync('at-loader', function(params, callback) {
^
TypeError: Cannot read property 'run' of undefined
at CheckerPlugin.apply (C:\source\ProjectFolder\Angular.Web.App\node_modules\awesome-typescript-loader\src\watch-mode.ts:5:18)
at Compiler.apply (C:\source\ProjectFolder\Angular.Web.App\node_modules\tapable\lib\Tapable.js:375:16)
at webpack (C:\source\ProjectFolder\Angular.Web.App\node_modules\webpack\lib\webpack.js:33:19)
at options.map.options (C:\source\ProjectFolder\Angular.Web.App\node_modules\webpack\lib\webpack.js:23:55)
at Array.map (<anonymous>)
at webpack (C:\source\ProjectFolder\Angular.Web.App\node_modules\webpack\lib\webpack.js:23:40)
at processOptions (C:\source\ProjectFolder\Angular.Web.App\node_modules\webpack\bin\webpack.js:335:15)
at yargs.parse (C:\source\ProjectFolder\Angular.Web.App\node_modules\webpack\bin\webpack.js:397:2)
at Object.Yargs.self.parse (C:\source\ProjectFolder\Angular.Web.App\node_modules\webpack\node_modules\yargs\yargs.js:533:18)
at Object.<anonymous> (C:\source\ProjectFolder\Angular.Web.App\node_modules\webpack\bin\webpack.js:152:7)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
at Function.Module.runMain (module.js:684:10)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! Angular.Web.App#1.0.0-rc3 build:webpack: `webpack --progress --color`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the Angular.Web.App#1.0.0-rc3 build:webpack script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\UserAccount\AppData\Roaming\npm-cache\_logs\2019-06-20T21_07_09_890Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! Angular.Web.App#1.0.0-rc3 build:dev: `npm run build:vendor && npm run build:webpack`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the Angular.Web.App#1.0.0-rc3 build:dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\UserAccount\AppData\Roaming\npm-cache\_logs\2019-06-20T21_07_09_936Z-debug.log
it is required, as our webpack is pulling in its CheckerPlugin
const CheckerPlugin = require('awesome-typescript-loader').CheckerPlugin;
module.exports = (env) => {
// Configuration in common to both client-side and server-side bundles
const isDevBuild = !(env && env.prod);
const sharedConfig = {
stats: { modules: false },
context: __dirname,
resolve: { extensions: [ '.js', '.ts' ] },
output: {
filename: '[name].js',
publicPath: 'dist/' // Webpack dev middleware, if enabled, handles requests for this URL prefix
},
module: {
rules: [
{ test: /\.ts$/, use: isDevBuild ? ['angular2-template-loader', 'angular2-router-loader'] : '#ngtools/webpack' },
{ test: /\.html$/, use: 'html-loader?minimize=false' },
{ test: /\.css$/, use: [ 'to-string-loader', isDevBuild ? 'css-loader' : 'css-loader?minimize' ] },
{ test: /\.(png|jpg|jpeg|gif|svg)$/, use: 'url-loader?limit=25000' },
...sharedModuleRules
]
},
plugins: [new CheckerPlugin()]
};
currenlty using awesome-typescript-loader v. 5.0.0

Related

Expo and Next.Js interfering when npm install

Im trying to setup a next js with native base and following the instructions, I am getting this.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: next-latest#undefined
npm ERR! Found: next#12.0.4
npm ERR! node_modules/next
npm ERR! next#"12.0.4" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer next#"^11" from #expo/next-adapter#3.1.10
npm ERR! node_modules/#expo/next-adapter
npm ERR! dev #expo/next-adapter#"^3.1.10" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\Zacha\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Zacha\AppData\Local\npm-cache\_logs\2022-01-20T00_16_08_660Z-debug-0.log
Aborting installation.
npm install has failed.
Try Following Steps.
Downgrade your next to 11
npm install next#11
Changes next.config.js to following code.
const { withExpo } = require('#expo/next-adapter');
const withPlugins = require('next-compose-plugins');
const withTM = require('next-transpile-modules')([
'native-base',
'react-native-svg',
'react-native-safe-area-context',
'#react-aria/visually-hidden',
'#react-native-aria/button',
'#react-native-aria/checkbox',
'#react-native-aria/combobox',
'#react-native-aria/focus',
'#react-native-aria/interactions',
'#react-native-aria/listbox',
'#react-native-aria/overlays',
'#react-native-aria/radio',
'#react-native-aria/slider',
'#react-native-aria/tabs',
'#react-native-aria/utils',
'#react-stately/combobox',
'#react-stately/radio',
]);
module.exports = withPlugins(
[withTM, [withExpo, { projectRoot: __dirname }], { webpack5: true }],
{
webpack: config => {
config.resolve.alias = {
...(config.resolve.alias || {}),
// Transform all direct `react-native` imports to `react-native-web`
'react-native$': 'react-native-web',
};
config.resolve.extensions = [
'.web.js',
'.web.ts',
'.web.tsx',
...config.resolve.extensions,
];
return config;
},
}
);
Add import React from 'react'; to _app.js.

Issue running express in MERN stack

This is the error I got on running npm start:
F:\Works\Projects\Node\Voice_pres_withbackend\api\node_modules\express\lib\router\index.js:458
throw new TypeError('Router.use() requires a middleware function but got a ' + gettype(fn))
^
TypeError: Router.use() requires a middleware function but got a string
at Function.use (F:\Works\Projects\Node\Voice_pres_withbackend\api\node_modules\express\lib\router\index.js:458:13)
at Function.<anonymous> (F:\Works\Projects\Node\Voice_pres_withbackend\api\node_modules\express\lib\application.js:220:21)
at Array.forEach (<anonymous>)
at Function.use (F:\Works\Projects\Node\Voice_pres_withbackend\api\node_modules\express\lib\application.js:217:7)
at Object.<anonymous> (F:\Works\Projects\Node\Voice_pres_withbackend\api\app.js:25:5)
at Module._compile (internal/modules/cjs/loader.js:956:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
at Module.load (internal/modules/cjs/loader.js:812:32)
at Function.Module._load (internal/modules/cjs/loader.js:724:14)
at Module.require (internal/modules/cjs/loader.js:849:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! api#0.0.0 start: `node ./bin/www`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the api#0.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\HP\AppData\Roaming\npm-cache\_logs\2020-09-21T14_50_24_855Z-debug.log
This is part of the code the error is pointing to :
var express = require("express");
var router = express.Router();
router.get("/", function (req, res) {
res.send("Api successful");
});
module.exports = router;
Can you please tell me what it is that I'm doing wrong?

Why do I get this error trying to run this VUE JS repository?

This is a VUE JS MASONRY project on the GitHub. I just trying to run
it. I've already run the npm install before run it. It seems like the
all the packages have been installed properly.
PS C:\Users\Administrator\Downloads\vue-masonry-plugin-demo-master>npm start
> vue-masonry-demo#1.0.0 start C:\Users\Administrator\Downloads\vue-masonry-plugin-demo-master
> node build/dev-server.js
> Starting dev server...
events.js:187
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE: address already in use :::8080
at Server.setupListenHandle [as _listen2] (net.js:1300:14)
at listenInCluster (net.js:1348:12)
at Server.listen (net.js:1436:7)
at Function.listen (C:\Users\Administrator\Downloads\vue-masonry-plugin-demo-master\node_modules\express\lib\application.js:618:24)
at Object.<anonymous> (C:\Users\Administrator\Downloads\vue-masonry-plugin-demo-master\build\dev-server.js:83:18)
at Module._compile (internal/modules/cjs/loader.js:956:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
at Module.load (internal/modules/cjs/loader.js:812:32)
at Function.Module._load (internal/modules/cjs/loader.js:724:14)
at Function.Module.runMain (internal/modules/cjs/loader.js:1025:10)
at internal/main/run_main_module.js:17:11
Emitted 'error' event on Server instance at:
at emitErrorNT (net.js:1327:8)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
code: 'EADDRINUSE',
errno: 'EADDRINUSE',
syscall: 'listen',
address: '::',
port: 8080
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! vue-masonry-demo#1.0.0 start: `node build/dev-server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the vue-masonry-demo#1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2020-02-05T22_23_37_278Z-debug.log
PS C:\Users\Administrator\Downloads\vue-masonry-plugin-demo-master>
PACKAGE.JSON
{ "name": "vue-masonry-demo", "version": "1.0.0",
"description": "A Vue.js project", "author": "Mikhail Kuznetcov
", "private": true, "scripts": {
"dev": "node build/dev-server.js",
"start": "node build/dev-server.js",
"build": "node build/build.js" },
Error: listen EADDRINUSE: address already in use :::8080
If you check it here, you will figure it out.

Running "npm run dev" on pet-shop-project fails and gives errors

Hi whenever I try to run the npm run dev in the terminal on pet-shop-project tutorial, it comes up with a long list of error here below the error.
hope to solve the issue by your help.
Thanks in advance.
PS C:\pet-shop-tutorial> npm run dev
> pet-shop#1.0.0 dev C:\pet-shop-tutorial
> lite-server
npm : C:\Users\Ali\AppData\Roaming\npm\node_modules\lite-server\lib\lite-server.js:33
At line:1 char:1
+ npm run dev
+ ~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (C:\Users\Ali\Ap...te-server.js:33:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
throw (err);
^
SyntaxError: C:\pet-shop-tutorial\bs-config.json: Unexpected token } in JSON at position 70
at JSON.parse (<anonymous>)
at Object.Module._extensions..json (module.js:671:27)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at start (C:\Users\Ali\AppData\Roaming\npm\node_modules\lite-server\lib\lite-server.js:28:17)
at Object.<anonymous> (C:\Users\Ali\AppData\Roaming\npm\node_modules\lite-server\bin\lite-server:7:30)
at Module._compile (module.js:652:30)
npm
ERR!
code
ELIFECYCLE
npm
ERR!
errno
1
npm
ERR!
pet-shop#1.0.0 dev: `lite-server`
npm
ERR!
Exit status 1
npm
ERR!
npm
ERR!
Failed at the pet-shop#1.0.0 dev script.
npm
ERR!
This is probably not a problem with npm. There is likely additional logging output above.
npm
ERR!
A complete log of this run can be found in:
npm
ERR!
C:\Users\Ali\AppData\Roaming\npm-cache\_logs\2018-05-30T01_41_54_260Z-debug.log
bs-config-json contents
{
"server": {
"baseDir": ["./src", "./build/contracts"],
}
}
The content of bs-config.json isn't valid JSON. You have an extra comma after the array. It should look like this:
{ "server": { "baseDir": ["./src", "./build/contracts"] } }
That's why you get this error:
SyntaxError: C:\pet-shop-tutorial\bs-config.json: Unexpected token } in JSON at position 70
You can validate your JSON using a JSON validator like https://jsonlint.com/.

FlorientR/laravel-gentelella: npm install --global bower gulp fails

I want to use the following framework:
https://github.com/FlorientR/laravel-gentelella
But when I follow the installation guide I need to run the following commands:
php artisan key:generate
npm install --global bower gulp
npm install
bower install
gulp
The first command works fine, but: npm install --global bower gulp fails. It gives the following error:
> C:\Program Files\nodejs\node_modules\npm\node_modules\request\node_modules\har-valid
ator\src\index.js:1
(function (exports, require, module, __filename, __dirname) { ����������������
^
SyntaxError: Unexpected token ILLEGAL
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\req
uest\lib\har.js:5:16)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\no
de_modules\\npm\\bin\\npm-cli.js" "install" "--global" "bower" "gulp"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
> npm ERR! C:\Program Files\nodejs\node_modules\npm\node_modules\request\node_modules\
har-validator\src\index.js:1
npm ERR! (function (exports, require, module, __filename, __dirname) { �������������
���
npm ERR! ^
npm ERR! Unexpected token ILLEGAL
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
The package.json contains:
{
"private": true,
"scripts": {
"prod": "gulp --production",
"dev": "gulp watch"
},
"devDependencies": {
"gulp": "^3.9.1",
"laravel-elixir": "^5.0.0",
"bootstrap-sass": "^3.0.0"
}
}
Do you guys see the problem?
I reinstalled NodeJs. That was the problem..