Module not found: Can't resolve './.htaccss' after installing React-boilerplate Dandelion starter project - reactjs

I have downloaded Dandelion starter-project and decompressed it on a local folder. I ran:
npm i
npm run build:dll
and then
npm start
then it complains:
> dandelion_pro#1.6.1 start /home/......./dandelion/starter-project
> cross-env NODE_ENV=development node server
Happy[js]: Version: 5.0.1. Threads: 5 (shared pool)
Server started ! ✓
Access URLs:
-----------------------------------
Localhost: http://localhost:3001
LAN: http://xxx.xxx.xxx.xxx:3001
-----------------------------------
Press CTRL-C to stop
Webpack is building script...
Happy[js]: All set; signaling webpack to proceed.
Browserslist: caniuse-lite is outdated. Please run next command `yarn upgrade`
webpack built 920e70412c607c0d50a6 in 3600ms
✖ 「wdm」:
ERROR in ./app/app.js
Module not found: Error: Can't resolve './.htaccess' in '/home/......./dandelion/starter-project/app'
# ./app/app.js 27:0-48
# multi ./node_modules/react-app-polyfill/ie11.js webpack-hot-middleware/client?reload=true ./app/app.js
I have searched the web looking for a solution, but I was unable to find one. My system is a Ubuntu 18.04.3 based machine running Linux Mint 19.3, nodejs 12.15.0 and npm 6.13.4. How can I solve this?

Well folks after an endless unsuccessful search on the web I created an empty ´.htaccess´ file and placed it into the ´app´ folder. Maybe this is not the better or the elegantest way to do it, but it worked for me.
I am posting this hoping it might be helpful.

Related

Next JS : Error: EPERM: operation not permitted, open

I am trying to build the next Js app production files to deploy it on cPanel, when I execute
npm run dev the app is working just fine but as I start to build a production file with the help of this video(https://youtu.be/1ykSXau838c) and executes npm run build it gives me an error in the terminal as given below:
PS C:\Users\hp\Desktop\reactJs-project\NextJs\test-app> npm run build
> test-app#0.1.0 build
> next build
info - Checking validity of types
info - Creating an optimized production build .node:events:368
throw er; // Unhandled 'error' event
^
Error: EPERM: operation not permitted, open 'C:\Users\hp\Desktop\reactJs-project\NextJs\test-app\.next\trace'
Emitted 'error' event on WriteStream instance at:
at emitErrorNT (node:internal/streams/destroy:157:8)
at emitErrorCloseNT (node:internal/streams/destroy:122:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
errno: -4048,
code: 'EPERM',
syscall: 'open',
path: 'C:\\Users\\hp\\Desktop\\reactJs-project\\NextJs\\test-app\\.next\\trace'
}
so I just want to know is there any way to solve this problem?
Posting comment from Koronag as an answer (as it helped me with this error and seems the most likely cause)...
This error is commonly seen when running a build while the dev server is already running. (E.g. in my case, I had a local build running via npm run dev and was trying to commit/push code, which invoked a Git Hook that also runs npm run dev.)
For me, it works fine this answer drives me to the resolver.
I run 2 scripts in terminals:
once for development
another for the build process.
So after killing the development script it looks perfectly fine!
From next-sitemap repo README.md
"Having next-sitemap command & next-sitemap.js file may result in file opening instead of building sitemaps in windows machines.
As a solution to this, it is now possible to use a custom config file instead of next-sitemap.js. Just pass --config .js to build command."
Next-Sitemap README.md - Building Sitemaps
The above worked for me

How to run Express-React project

I`m trying to understand how to run this project, published on GitHub here
No idea how. I ran npm i, and then npm start, but I got these messages:
npm start
> fed-entry-level-exam-root#1.0.0 start C:\entry-level-exam_19\entry-level-exam
> lerna run start --parallel
lerna notice cli v3.22.1
lerna info Executing command in 2 packages: "npm run start"
#fed-exam/client: > #fed-exam/client#1.0.0 start C:\entry-level-exam_19\entry-level-exam\client
#fed-exam/client: > set CI=true && react-scripts start
#fed-exam/server: > #fed-exam/server#1.0.0 start C:\entry-level-exam_19\entry-level-exam\server
#fed-exam/server: > ts-node-dev index.ts
#fed-exam/server: [INFO] 21:51:34 ts-node-dev ver. 1.1.0 (using ts-node ver. 9.1.1, typescript ver. 3.9.9)
#fed-exam/server: starting server { serverAPIPort: 3232, APIPath: '/api/tickets' }
#fed-exam/server: server running 3232
#fed-exam/client: i 「wds」: Project is running at http://192.168.0.108/
#fed-exam/client: i 「wds」: webpack output is served from
#fed-exam/client: i 「wds」: Content not from webpack is served from C:\entry-level-exam_19\entry-level-exam\client\public
#fed-exam/client: i 「wds」: 404s will fallback to /
#fed-exam/client: Starting the development server...
I tried to open http://localhost:3232/ but I getting this error:
Cannot GET /
Also tried :
http://localhost:3000
Which is known for React localhost.
So far I don't know how to make it work.
Any help will be appreciated.
run the client and server separately,
after running npm install and npm start
open a new terminal and run npm start inside client/ directory
If you carefully read messages on the console you will notice where the api is running.
The lines
#fed-exam/server: starting server { serverAPIPort: 3232, APIPath: '/api/tickets' }
#fed-exam/server: server running 3232
Shows that server project is running at port 3232, but that api path starts at /api/tickets. So, for access the root of the api, access http://localhost:3232/api/tickets.
You could check how this works by checking the express app code on server folder.
And there is a problem with the client code that is related with react-scripts when trying to run projects using lerna package. The line
Content not from webpack is served from C:\entry-level-exam_19\entry-level-exam\client\public
Was previously reported as error here: Content not from webpack is served from /foo
Try to solve the issue using our colleagues suggestions.

Deploy React JS SPA in Openshift

I have build a React JS app and triggered yarn build command. Its builded successfully and if I run yarn global add serve, its working perfectly on http://localhost:5000. After that I tried below link to deploy this code to OpenShift.
OpenShift Deployment
According to the document, I tried to run npx nodeshift --strictSSL=false --dockerImage=bucharestgold/centos7-s2i-web-app --imageTag=10.13.0 --build.env YARN_ENABLED=true --expose
Then I got this log -
npx: installed 216 in 37.284s
kubernetes-client deprecated require('kubernetes-client').config, use require('kubernetes-client/backends/request').config. ..\..\Users\RITUPARNABHATTACHARY\AppData\Roaming\npm-cache\_npx\11068\node_modules\nodeshift\node_modules\openshift-rest-client\lib\openshift-rest-client.js:25:35
kubernetes-client deprecated require('kubernetes-client').config, use require('kubernetes-client/backends/request').config. ..\..\Users\RITUPARNABHATTACHARY\AppData\Roaming\npm-cache\_npx\11068\node_modules\nodeshift\node_modules\openshift-rest-client\index.js:23:39
2019-12-21T11:58:07.841Z INFO loading configuration
kubernetes-client deprecated fromKubeconfig see https://github.com/godaddy/kubernetes-client/blob/master/merging-with-kubernetes.md#request-kubeconfig- ..\..\Users\RITUPARNABHATTACHARY\AppData\Roaming\npm-cache\_npx\11068\node_modules\nodeshift\lib\nodeshift-config.js:35:32
2019-12-21T11:58:07.882Z INFO using namespace smart-learner at https://c101-e.jp-tok.containers.cloud.ibm.com:30512
kubernetes-client deprecated Client({ config }), see https://github.com/godaddy/kubernetes-client/blob/master/merging-with-kubernetes.md ..\..\Users\RITUPARNABHATTACHARY\AppData\Roaming\npm-cache\_npx\11068\node_modules\nodeshift\node_modules\openshift-rest-client\lib\openshift-rest-client.js:95:18
kubernetes-client deprecated Request() without a .kubeconfig option, see https://github.com/godaddy/kubernetes-client/blob/master/merging-with-kubernetes.md ..\..\Users\RITUPARNABHATTACHARY\AppData\Roaming\npm-cache\_npx\11068\node_modules\nodeshift\node_modules\kubernetes-client\lib\swagger-client.js:200:19
2019-12-21T11:58:07.928Z WARNING a file property was not found in your package.json, archiving the current directory.
2019-12-21T11:58:07.929Z INFO creating archive of .gitignore, build, Dockerfile, package-lock.json, package.json, public, README.md, src, yarn.lock
2019-12-21T11:58:09.001Z INFO using existing build configuration smartlearner-s2i
2019-12-21T11:58:09.377Z INFO using existing image stream smartlearner
2019-12-21T11:58:09.378Z INFO uploading binary archive C:\ReactAPP\smartlearner/tmp/nodeshift/build/archive.tar
2019-12-21T11:58:15.825Z INFO binary upload complete
2019-12-21T11:58:15.828Z INFO waiting for build to finish
kubernetes-client deprecated .getStream use .getByteStream, see https://github.com/godaddy/kubernetes-client/blob/master/merging-with-kubernetes.md ..\..\Users\RITUPARNABHATTACHARY\AppData\Roaming\npm-cache\_npx\11068\node_modules\nodeshift\lib\build-watcher.js:56:107
2019-12-21T11:58:19.798Z TRACE Using bucharestgold/centos7-s2i-web-app:10.x as the s2i builder image
2019-12-21T11:58:20.550Z TRACE ls: cannot access /tmp/src/node_modules: No such file or directory
2019-12-21T11:58:20.564Z TRACE ---> Installing application source
2019-12-21T11:58:20.585Z TRACE ---> Building your Web Application from source
2019-12-21T11:58:20.592Z TRACE Current git config
2019-12-21T11:58:20.620Z TRACE url.https://github.com.insteadof=git#github.com:
2019-12-21T11:58:20.629Z TRACE url.https://.insteadof=ssh://
2019-12-21T11:58:20.629Z TRACE url.https://github.com.insteadof=ssh://git#github.com
2019-12-21T11:58:20.630Z TRACE ---> Using 'yarn install' with YARN_ARGS
2019-12-21T11:58:21.356Z TRACE yarn install v1.10.1
2019-12-21T11:58:21.594Z TRACE warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
2019-12-21T11:58:21.657Z TRACE [1/4] Resolving packages...
2019-12-21T11:58:23.111Z TRACE [2/4] Fetching packages...
2019-12-21T11:58:53.081Z TRACE error #typescript-eslint/eslint-plugin#2.10.0: The engine "node" is incompatible with this module. Expected version "^8.10.0 || ^10.13.0 || >=11.10.1". Got "10.12.0"
2019-12-21T11:58:53.083Z TRACE error Found incompatible module
2019-12-21T11:58:53.086Z TRACE info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
2019-12-21T11:58:58.441Z TRACE error: build error: non-zero (13) exit code from bucharestgold/centos7-s2i-web-app:10.x
2019-12-21T11:59:00.497Z ERROR build failed with message: Assemble script failed.
2019-12-21T11:59:00.503Z ERROR Assemble script failed.
i am not able to understand what I am missing here. I found that bucharestgold/centos7-s2i-web-app has been depreicated and tried with npx nodeshift --strictSSL=false --dockerImage=nodeshift/ubi8-s2i-web-app --build.env YARN_ENABLED=true --deploy.env NPM_RUN="npx yarn start" --deploy.port=3000 --expose. This is also throwing same error message.
You can use the new web-app flag feature and let nodeshift set the appropriate docker image.
Try running this command instead npx nodeshift --web-app --build.env YARN_ENABLED=true --deploy.env NPM_RUN="npx yarn start" --deploy.port=3000

yarn install error:Failed to download Chromium

The Yarn install failed to download Chromium. Error is as follows:
D:\workspace\www\ant-design-mobile-pro
λ yarn
yarn install v1.12.3
//...
Directory: D:\\workspace\\www\\ant-design-mobile-pro\\node_modules\\puppeteer
Output:
ERROR: Failed to download Chromium r599821! Set \"PUPPETEER_SKIP_CHROMIUM_DOWNLOAD\" env variable to skip download.
{ Error: connect ETIMEDOUT 172.217.161.176:443
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1113:14)
errno: 'ETIMEDOUT',
code: 'ETIMEDOUT',
syscall: 'connect',
address: '172.217.161.176',
success Saved lockfile.
Done in 343.80s.
Question:
Can I download Chromium manually? I can download it from https://npm.taobao.org/mirrors/chromium-browser-snapshots/Win_x64/,the question is: Where should I put it after dowloading it?
If you don't intend to run the automated browser tests which depend upon Chromium, you can skip the install per the error message:
export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true && yarn
I've occasionally encountered this yarn install timeout recently as well, and no cache clear or other manipulation has seemed to resolve it.

Angular theme start

I have problem with starting Angular theme. I have installed everything on this planet, and that wont work.
When i start gulp serve in cmd , this is response:
D:\Kolokvijumi\blur-admin-master\blur-admin-master\node_modules>gulp serve
[21:07:45] Working directory changed to D:\Kolokvijumi\blur-admin-master\blur-ad
min-master
[21:07:46] Using gulpfile D:\Kolokvijumi\blur-admin-master\blur-admin-master\gul
pfile.js
[21:07:46] Starting 'scripts'...
[21:07:46] Starting 'styles'...
[21:07:46] Starting 'stylesAuth'...
[21:07:46] Starting 'styles404'...
[21:07:46] Starting 'copyVendorImages'...
D:\Kolokvijumi\blur-admin-master\blur-admin-master\node_modules\eslint\lib\eslin
t.js:706
throw ex;
^
TypeError: Error while loading rule 'react/display-name': ruleCreator is not a f
unction
at D:\Kolokvijumi\blur-admin-master\blur-admin-master\node_modules\eslint\li
b\eslint.js:692:28
at Array.forEach (native)
at EventEmitter.module.exports.api.verify (D:\Kolokvijumi\blur-admin-master\
blur-admin-master\node_modules\eslint\lib\eslint.js:671:16)
at processText (D:\Kolokvijumi\blur-admin-master\blur-admin-master\node_modu
les\eslint\lib\cli-engine.js:230:27)
at CLIEngine.executeOnText (D:\Kolokvijumi\blur-admin-master\blur-admin-mast
er\node_modules\eslint\lib\cli-engine.js:686:26)
at verify (D:\Kolokvijumi\blur-admin-master\blur-admin-master\node_modules\g
ulp-eslint\index.js:20:17)
at Transform._transform (D:\Kolokvijumi\blur-admin-master\blur-admin-master\
node_modules\gulp-eslint\index.js:38:18)
at Transform._read (_stream_transform.js:167:10)
at Transform._write (_stream_transform.js:155:12)
at doWrite (_stream_writable.js:334:12)
I installed eslint, npm, babel-eslint but didnt help..
A couple of suggestions:
1) since npm is kinda buggy, you should definitely try to wipe you node_modules folder and give an npm cache clean command. After that try reinstalling everything again with npm install
2) which version of Node are you using? There may be any compatibility issues with your current node version and the one needed by you modules. You should also have to try to use nvm to manage multiple node version on your system
--- EDIT (after the other answer) ---
Probably you need to (re)install ESLint Config Defaults module.

Resources