Upgraded to Mojave and now Webpack build fails - javascript

After upgrading to Mojave, running webpack --mode development on my project now gives me the following error:
ERROR in ./src/templates/contact-list-item.hbs
Module build failed (from ./node_modules/handlebars-loader/index.js):
/Users/username/Desktop/Project/Public/js/node_modules/loader-utils/lib/urlToRequest.js:7
const moduleRequestRegex = /^[^?]*../../;
^
This error is repeated for each of my .hbs files.
I'm uncertain whether this is an npm problem or a webpack problem. I wonder what installing MacOS Mojave might have changed to break this. If anyone has any ideas I would be very grateful! :)
Full stack trace
SyntaxError: Unexpected token .
at new Script (vm.js:74:7)
at NativeCompileCache._moduleCompile (/usr/local/lib/node_modules/webpack-cli/node_modules/v8-compile-cache/v8-compile-cache.js:226:18)
at Module._compile (/usr/local/lib/node_modules/webpack-cli/node_modules/v8-compile-cache/v8-compile-cache.js:172:36)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:689:10)
at Module.load (internal/modules/cjs/loader.js:589:32)
at tryModuleLoad (internal/modules/cjs/loader.js:528:12)
at Function.Module._load (internal/modules/cjs/loader.js:520:3)
at Module.require (internal/modules/cjs/loader.js:626:17)
at require (/usr/local/lib/node_modules/webpack-cli/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
at Object.<anonymous> (/Users/sammettam/Desktop/Vapor3Test/Public/js/node_modules/loader-utils/lib/index.js:8:22)
at Module._compile (/usr/local/lib/node_modules/webpack-cli/node_modules/v8-compile-cache/v8-compile-cache.js:178:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:689:10)
at Module.load (internal/modules/cjs/loader.js:589:32)
at tryModuleLoad (internal/modules/cjs/loader.js:528:12)
at Function.Module._load (internal/modules/cjs/loader.js:520:3)
at Module.require (internal/modules/cjs/loader.js:626:17)
at require (/usr/local/lib/node_modules/webpack-cli/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
at Object.<anonymous> (/Users/sammettam/Desktop/Vapor3Test/Public/js/node_modules/handlebars-loader/index.js:1:81)
at Module._compile (/usr/local/lib/node_modules/webpack-cli/node_modules/v8-compile-cache/v8-compile-cache.js:178:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:689:10)
at Module.load (internal/modules/cjs/loader.js:589:32)
at tryModuleLoad (internal/modules/cjs/loader.js:528:12)
at Function.Module._load (internal/modules/cjs/loader.js:520:3)
at Module.require (internal/modules/cjs/loader.js:626:17)
at require (/usr/local/lib/node_modules/webpack-cli/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
at loadLoader (/usr/local/lib/node_modules/webpack/node_modules/loader-runner/lib/loadLoader.js:13:17)
at iteratePitchingLoaders (/usr/local/lib/node_modules/webpack/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
at runLoaders (/usr/local/lib/node_modules/webpack/node_modules/loader-runner/lib/LoaderRunner.js:362:2)
at NormalModule.doBuild (/usr/local/lib/node_modules/webpack/lib/NormalModule.js:265:3)
at NormalModule.build (/usr/local/lib/node_modules/webpack/lib/NormalModule.js:412:15)
# ./src/features/contacts/contact-form.js 7:0-65 62:17-37
# ./src/components/create-menu.js
# ./src/app.js

Related

webpack is watching for changes node_modules/micromatch/index.js:44

i am facing this error .I have deleted node_modules file many time still facing this problem
please help in reolving this problem
let isMatch = picomatch(String(patterns[i]), { ...options, onResult }, true);
^^^
SyntaxError: Unexpected token ...
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:542:28)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/home/jayant/repo/jj/node_modules/browser-sync/dist/public/stream.js:3:18)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
[23:28:54] webpack is watching for changes
my node vesion is v6.11.2 and npm version:3.10.10
I didn't want to upgrade my node version,upgrading could have solved my problem easily.
I have resolve this issue by downgrading my browser-sync version i.e 2.26.7
You can try installing every version of it , by npm install browser-sync#version
you can check version from https://www.npmjs.com/package/browser-sync

State changed from starting to crashed can not find express

I am using Heroku as a server but after deploying app does not run
Error: Cannot find module './lib/express' at
Function.Module._resolveFilename
(internal/modules/cjs/loader.js:582:15)
at Function.Module._load (internal/modules/cjs/loader.js:508:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object. (/app/node_modules/express/index.js:11:18)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js
(internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad
at Function.Module._load (internal/modules/cjs/loader.js:531:3)

Updating Angular 6 to angular 7 got error

When updating angular 6 to angular 7 I got error. I first used this command npm i -g rxjs-tslint. And then I used this command rxjs-5-to-6-migrate -p src/tsconfig.app.json.I got this error.
module.js:550
throw err;
^
Error: Cannot find module 'typescript'
at Function.Module._resolveFilename (module.js:548:15)
at Function.Module._load (module.js:475:25)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/usr/lib/node_modules/rxjs-tslint/node_modules/tslint/lib/linter.js:22:10)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
child_process.js:645
throw err;
^
Error: Command failed: "/usr/lib/node_modules/rxjs-tslint/node_modules/.bin/tslint" -c "/usr/lib/node_modules/rxjs-tslint/rxjs-5-to-6-migrate.json" -p "src/tsconfig.app.json" --fix
module.js:550
throw err;
^
Error: Cannot find module 'typescript'
at Function.Module._resolveFilename (module.js:548:15)
at Function.Module._load (module.js:475:25)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/usr/lib/node_modules/rxjs-tslint/node_modules/tslint/lib/linter.js:22:10)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at checkExecSyncError (child_process.js:602:13)
at Object.execSync (child_process.js:642:13)
at migrate (/usr/lib/node_modules/rxjs-tslint/rxjs-5-to-6-migrate.js:18:34)
at Object.<anonymous> (/usr/lib/node_modules/rxjs-tslint/rxjs-5-to-6-migrate.js:25:14)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)
This release needs upgrade: It requires typescript to be installed globally. Also the user must manually add "typescript" as a dev dependency to existing projects. Otherwise, there will be build errors.

How can I import a node js project to another node js project?

I want to use /folder1/folder2/a.js in /folder3/folder4/b.js.
In b.js, i tried
var a = require('../folder1/folder2/a.js');
but this is not working. Please suggest me the correct way to do this.
error:module.js:471
throw err;
^
> Error: Cannot find module '../folder1/folder2/a.js'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (C:\Users\502660706\workspace\folder3\folder4\b.js:1:85)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
according to the output message you're giving a wrong path of the file.
Error: Cannot find module '

Node JS Ubunto Production require error

I have deployed my Node js Application to digitalocean Ubuntu servers. Everything runs fine on localhost. For some reason when I start my node app using "node app.js" on ubuntu digital ocean, I am thrown "Cannot find module '../../Models". The "models" directory includes a few files that i have created including an index.js. My app is correctly configured and installed and I have been working on solving this issue for 2 days. Is ubuntu case sensitive for locating directories? I can't seem to figure out why my modules cannot be located. Thanks.
deploy#yw://home/deploy/ywapp$ node app
module.js:340
throw err;
^
Error: Cannot find module '../../Models'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/home/deploy/ywapp-1455754628602/routes/access_token/token.js:4: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)
at Object.<anonymous> (/home/deploy/ywapp-1455754628602/routes/access_token/index.js:2:11)
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)
at Object.<anonymous> (/home/deploy/ywapp-1455754628602/routes/auth/user.js:13:12)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)

Categories