error in building a nodejs application - javascript

I'm trying to get this github project to work. These are the steps I followed
cloned it using git clone <url>
Execute npm install inside the new directory
Execute npm run build
Finally start the server with npm start
But step 3 gives errors regarding missing files and directories. Is there any step I'm missing?
If possible can anyone run it and confirm the error?
ERROR in ./src/index.js
Module not found: Error: Cannot resolve 'file' or 'directory' ./components/App in /home/terry/dethread-demo-applications/src
# ./src/index.js 11:11-38

Related

How to solve this - Could not resolve "app/javascript/*.*" issue in Rails

I am currently working on a full-stack application where I need to use React for the Front-end and Rails for Back-end. I am using Esbuild which gives me access to make use of jsx in rails. However, I am having a series of issues with it as shown below. Please, how do I resolve this [ERROR] Could not resolve "app/javascript/*.*"
Could it be that it's not compatible with my system because I am seeing so many incompatibility issues in the log.
Done in 65.24s.
Add build script
run npm set-script build "esbuild app/javascript/*.* --bundle --sourcemap --outdir=app/assets/builds --public-path=assets" from "."
npm WARN set-script set-script is deprecated, use `npm pkg set scripts.scriptname="cmd" instead.
run yarn build from "."
yarn run v1.22.15
warning ..\package.json: No license field
$ esbuild app/javascript/*.* --bundle --sourcemap --outdir=app/assets/builds --public-path=assets
X [ERROR] Could not resolve "app/javascript/*.*"
It looks like you are trying to use glob syntax (i.e. "*") with esbuild. This syntax is
typically handled by your shell, and isn't handled by esbuild itself. You must expand glob
syntax first before passing your paths to esbuild.
1 error
node:child_process:879
throw err;
^
Error: Command failed: C:\Users\Dennis\hello-rails-react\node_modules\esbuild-windows-64\esbuild.exe app/javascript/*.* --bundle --sourcemap --outdir=app/assets/builds --public-path=assets
I had the same error while building my rails application.
In the package.json file. In the scripts section, Instead of a general path
app/javascript/*.*
I specified the exact file name
app/javascript/application.js
and my problem was solved.

Module not found: Can't resolve './Header.module.scss' in '/vercel/path0/components/Header'

I got this error when I try to deploy my next application to vercel.
I checked my imports multiple times but I can't see where is the problem.
Module not found: Can't resolve './Header.module.scss' in '/vercel/path0/components/Header'
```
If you are using git, use the git config core.ignorecase false command in your local environment and then commit.

Can't walk dependency graph: Cannot find module './crypto_auth' sodium-universal

I am getting the following error when attempting to browserify a node project (https://github.com/datproject/sdk) and am getting the following error.
Error: Can't walk dependency graph: Cannot find module './crypto_auth' from 'C:\myPath\node_modules\sodium-universal\index.js'
required by C:\myPath\node_modules\sodium-universal\index.js
at C:\myPath\node_modules\resolve\lib\async.js:137:35
at load (C:\myPath\node_modules\resolve\lib\async.js:156:43)
at onex (C:\myPath\node_modules\resolve\lib\async.js:181:17)
at C:\myPath\node_modules\resolve\lib\async.js:15:69
at FSReqCallback.oncomplete (fs.js:158:21)
npm ERR! code ELIFECYCLE
Usually I'd npm install the missing module. However, this doesn't work in this case. Also I can find no mention of crypt_auth anywhere in the project (the referencedindex.js has a single line module.exports = require('sodium-native'))
How do I debug this?
After Paul90's comment here, I solved like this:
cd into the yourPath/node_modules/sodium-universal/build-scripts dir
run node generate.js
go back to the sdk dir and run npm run build

warn Error on lookup for github:systemjs/systemjs

When I am setting my jspm installation with the command:
jspm init
Then it just asks me for the initial config:
Would you like jspm to prefix the jspm package.json properties under jspm? [yes]:yes
Enter server baseURL (public folder path) [./]:app
Enter jspm packages folder [app/jspm_packages]:
Enter config file path [app/config.js]:
Configuration file app/config.js doesn't exist, create it? [yes]:yes
Enter client baseURL (public folder URL) [/]:
Do you wish to use a transpiler? [yes]:no
Right after that, I am getting this error message:
warn Error on lookup for github:systemjs/systemjs
TypeError: "timeout" must be an unsigned integer
at validateTimeout (child_process.js:612:11)
at Object.exports.execFile (child_process.js:178:3)
at exports.exec (child_process.js:136:18)
at module.exports (/usr/local/lib/node_modules/jspm/node_modules/jspm-github/exec-git.js:64:5)
at /usr/local/lib/node_modules/jspm/node_modules/jspm-github/github.js:382:7
at initializePromise (/usr/local/lib/node_modules/jspm/node_modules/rsvp/dist/rsvp.js:588:5)
at new Promise (/usr/local/lib/node_modules/jspm/node_modules/rsvp/dist/rsvp.js:1076:31)
at GithubLocation.lookup (/usr/local/lib/node_modules/jspm/node_modules/jspm-github/github.js:381:12)
at /usr/local/lib/node_modules/jspm/lib/registry.js:117:30
at tryCatch (/usr/local/lib/node_modules/jspm/node_modules/rsvp/dist/rsvp.js:538:12)
at invokeCallback (/usr/local/lib/node_modules/jspm/node_modules/rsvp/dist/rsvp.js:553:13)
at /usr/local/lib/node_modules/jspm/node_modules/rsvp/dist/rsvp.js:628:16
at flush (/usr/local/lib/node_modules/jspm/node_modules/rsvp/dist/rsvp.js:2373:5)
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickCallback (internal/process/next_tick.js:104:9)
err
err Error downloading loader files.
err
Not sure what is happening right there. So I came here for some clues.
After trying too much to find was going on. I came with, it was happening that Jspm had no problems but my Node and Npm version were a pre-release (it seems like this affects the Jspm registry). I was using NodeJs 8.0.0. Anyway if someone stucks on the same, he/she should know that going back to
node v6.10.3 (npm v3.10.10) versions
fix this little inconvenient.
Works for me, the below commands:
brew update
brew install nvm
source $(brew --prefix nvm)/nvm.sh (adding to ~/.profile)
nvm install 6.10.3
For more information this is an excellent post about it

Angular 2 polyfills trouble

So I had a hard drive failure and lost everything but of course github to the rescue. I recently finished my first Angular 2 project and did a git clone to recover it and every time I try to run ng server I get this error...
ERROR in ./src/main.ts
Module build failed: TypeError: Cannot read property 'newLine' of undefined
at Object.getNewLineCharacter (D:\GitHub\sandbox\meadowbrook_acres\angular-src\node_modules\typescript\lib\typescript.js:8062:20)
at Object.createCompilerHost (D:\GitHub\sandbox\meadowbrook_acres\angular-src\node_modules\typescript\lib\typescript.js:44978:26)
at Object.ngcLoader (D:\GitHub\sandbox\meadowbrook_acres\angular-src\node_modules\#ngtools\webpack\src\loader.js:338:33)
# multi webpack-dev-server/client?http://localhost:4200 ./src/main.ts
ERROR in ./src/polyfills.ts
Module build failed: TypeError: Cannot read property 'newLine' of undefined
at Object.getNewLineCharacter (D:\GitHub\sandbox\meadowbrook_acres\angular-src\node_modules\typescript\lib\typescript.js:8062:20)
at Object.createCompilerHost (D:\GitHub\sandbox\meadowbrook_acres\angular-src\node_modules\typescript\lib\typescript.js:44978:26)
at Object.ngcLoader (D:\GitHub\sandbox\meadowbrook_acres\angular-src\node_modules\#ngtools\webpack\src\loader.js:338:33)
# multi ./src/polyfills.ts`
I did an npm install on both the project folder and the angular src folder then did a npm install typings --global after googling this error and still it doesn't allow me to do anything. any other ideas on what I can do?

Categories

Resources